kuali-rice 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c1e7c363cd4ae3964ba359bbc8929280639437ed
4
+ data.tar.gz: 5a84b68b902141e6b2f2a819cdc9fbbaf698d8f3
5
+ SHA512:
6
+ metadata.gz: 712224d800b5f00a1d88456c8051be12fb0a265bdbe98ea552a4875b4909b06deeacc8c068d5b05e8756a844735b7d9382989add79585045ae232a05db13020c
7
+ data.tar.gz: 8031910d9c3838694c61a6b8a8c75435a155c37b98f181bd1800ac81424a97a7c328d97e42d78b32a2a40448f3507cdcabba8d0dea48cccfa8b2dc3e22d8f582
data/Gemfile CHANGED
@@ -9,9 +9,9 @@ gem "xml-simple", ">= 0"
9
9
  # Include everything needed to run rake, tests, features, etc.
10
10
  group :development do
11
11
  gem "shoulda", ">= 0"
12
- gem "bundler", "~> 1.0.0"
13
- gem "jeweler", "~> 1.5.2"
14
- gem "rcov", ">= 0"
12
+ gem "bundler"
13
+ gem "jeweler"
14
+ gem "simplecov", ">= 0"
15
15
  gem "xml-simple", ">= 0"
16
16
  gem 'ci_reporter', ">= 0"
17
17
  gem 'builder', ">= 0"
@@ -1,27 +1,82 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- builder (2.1.2)
5
- ci_reporter (1.6.2)
4
+ activesupport (4.0.0)
5
+ i18n (~> 0.6, >= 0.6.4)
6
+ minitest (~> 4.2)
7
+ multi_json (~> 1.3)
8
+ thread_safe (~> 0.1)
9
+ tzinfo (~> 0.3.37)
10
+ addressable (2.3.5)
11
+ atomic (1.1.14)
12
+ builder (3.2.2)
13
+ ci_reporter (1.9.0)
6
14
  builder (>= 2.1.2)
7
- git (1.2.5)
8
- jeweler (1.5.2)
9
- bundler (~> 1.0.0)
15
+ faraday (0.8.8)
16
+ multipart-post (~> 1.2.0)
17
+ git (1.2.6)
18
+ github_api (0.10.1)
19
+ addressable
20
+ faraday (~> 0.8.1)
21
+ hashie (>= 1.2)
22
+ multi_json (~> 1.4)
23
+ nokogiri (~> 1.5.2)
24
+ oauth2
25
+ hashie (2.0.5)
26
+ highline (1.6.19)
27
+ httpauth (0.2.0)
28
+ i18n (0.6.5)
29
+ jeweler (1.8.8)
30
+ builder
31
+ bundler (~> 1.0)
10
32
  git (>= 1.2.5)
33
+ github_api (= 0.10.1)
34
+ highline (>= 1.6.15)
35
+ nokogiri (= 1.5.10)
11
36
  rake
12
- rake (0.8.7)
13
- rcov (0.9.9)
14
- shoulda (2.11.3)
15
- xml-simple (1.0.12)
37
+ rdoc
38
+ json (1.8.0)
39
+ jwt (0.1.8)
40
+ multi_json (>= 1.5)
41
+ minitest (4.7.5)
42
+ multi_json (1.8.1)
43
+ multi_xml (0.5.5)
44
+ multipart-post (1.2.0)
45
+ nokogiri (1.5.10)
46
+ oauth2 (0.9.2)
47
+ faraday (~> 0.8)
48
+ httpauth (~> 0.2)
49
+ jwt (~> 0.1.4)
50
+ multi_json (~> 1.0)
51
+ multi_xml (~> 0.5)
52
+ rack (~> 1.2)
53
+ rack (1.5.2)
54
+ rake (10.1.0)
55
+ rdoc (4.0.1)
56
+ json (~> 1.4)
57
+ shoulda (3.5.0)
58
+ shoulda-context (~> 1.0, >= 1.0.1)
59
+ shoulda-matchers (>= 1.4.1, < 3.0)
60
+ shoulda-context (1.1.5)
61
+ shoulda-matchers (2.4.0)
62
+ activesupport (>= 3.0.0)
63
+ simplecov (0.7.1)
64
+ multi_json (~> 1.0)
65
+ simplecov-html (~> 0.7.1)
66
+ simplecov-html (0.7.1)
67
+ thread_safe (0.1.3)
68
+ atomic
69
+ tzinfo (0.3.38)
70
+ xml-simple (1.1.2)
16
71
 
17
72
  PLATFORMS
18
73
  ruby
19
74
 
20
75
  DEPENDENCIES
21
76
  builder
22
- bundler (~> 1.0.0)
77
+ bundler
23
78
  ci_reporter
24
- jeweler (~> 1.5.2)
25
- rcov
79
+ jeweler
26
80
  shoulda
81
+ simplecov
27
82
  xml-simple
data/Rakefile CHANGED
@@ -38,17 +38,9 @@ Rake::TestTask.new(:test) do |test|
38
38
  test.verbose = true
39
39
  end
40
40
 
41
- require 'rcov/rcovtask'
42
- Rcov::RcovTask.new do |test|
43
- test.libs << 'test'
44
- test.pattern = 'test/**/test_*.rb'
45
- test.verbose = true
46
- test.rcov_opts << '--exclude "gems/*"'
47
- end
48
-
49
41
  task :default => :test
50
42
 
51
- require 'rake/rdoctask'
43
+ require 'rdoc/task'
52
44
  Rake::RDocTask.new do |rdoc|
53
45
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
54
46
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{kuali-rice}
8
- s.version = "0.1.1"
7
+ s.name = "kuali-rice"
8
+ s.version = "0.2.0"
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{2011-02-01}
13
- s.description = %q{This gem is used to interface with a RICE install via REST services}
14
- s.email = %q{shawn.bower@gmail.com}
12
+ s.date = "2013-10-11"
13
+ s.description = "This gem is used to interface with a RICE install via REST services"
14
+ s.email = "shawn.bower@gmail.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.rdoc"
@@ -27,51 +27,42 @@ Gem::Specification.new do |s|
27
27
  "kuali-rice.gemspec",
28
28
  "lib/kuali-rice.rb",
29
29
  "lib/kuali-rice/KualiRESTInterface.rb",
30
- "lib/kuali-rice/KualiRESTInterface/DocumentActions.rb",
30
+ "lib/kuali-rice/KualiRESTInterface/PermissionInterface.rb",
31
31
  "lib/kuali-rice/KualiRESTInterface/PersonInterface.rb",
32
32
  "lib/kuali-rice/KualiRESTInterface/RestAPI.rb",
33
33
  "lib/kuali-rice/Responses.rb",
34
- "lib/kuali-rice/Responses/ActionItem.rb",
35
- "lib/kuali-rice/Responses/DocumentResponse.rb",
36
- "lib/kuali-rice/Responses/ErrorResponse.rb",
34
+ "lib/kuali-rice/Responses/Assignees.rb",
37
35
  "lib/kuali-rice/Responses/Person.rb",
38
- "lib/kuali-rice/Responses/StandardResponse.rb",
39
36
  "support/DocumentFinalFYIRouting.xml",
40
37
  "support/RiceWSDocType.xml",
41
38
  "test/helper.rb",
42
- "test/test_kuali-rice.rb",
39
+ "test/test_permission_interface.rb",
43
40
  "test/test_person_interface.rb"
44
41
  ]
45
- s.homepage = %q{http://github.com/sbower/kuali-rice}
42
+ s.homepage = "http://github.com/sbower/kuali-rice"
46
43
  s.licenses = ["MIT"]
47
44
  s.require_paths = ["lib"]
48
- s.rubygems_version = %q{1.3.7}
49
- s.summary = %q{This gem is used to interface with a RICE install via REST services}
50
- s.test_files = [
51
- "test/helper.rb",
52
- "test/test_kuali-rice.rb",
53
- "test/test_person_interface.rb"
54
- ]
45
+ s.rubygems_version = "2.0.6"
46
+ s.summary = "This gem is used to interface with a RICE install via REST services"
55
47
 
56
48
  if s.respond_to? :specification_version then
57
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
58
- s.specification_version = 3
49
+ s.specification_version = 4
59
50
 
60
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
61
52
  s.add_runtime_dependency(%q<xml-simple>, [">= 0"])
62
53
  s.add_development_dependency(%q<shoulda>, [">= 0"])
63
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
64
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
65
- s.add_development_dependency(%q<rcov>, [">= 0"])
54
+ s.add_development_dependency(%q<bundler>, [">= 0"])
55
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
56
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
66
57
  s.add_development_dependency(%q<xml-simple>, [">= 0"])
67
58
  s.add_development_dependency(%q<ci_reporter>, [">= 0"])
68
59
  s.add_development_dependency(%q<builder>, [">= 0"])
69
60
  else
70
61
  s.add_dependency(%q<xml-simple>, [">= 0"])
71
62
  s.add_dependency(%q<shoulda>, [">= 0"])
72
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
73
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
74
- s.add_dependency(%q<rcov>, [">= 0"])
63
+ s.add_dependency(%q<bundler>, [">= 0"])
64
+ s.add_dependency(%q<jeweler>, [">= 0"])
65
+ s.add_dependency(%q<simplecov>, [">= 0"])
75
66
  s.add_dependency(%q<xml-simple>, [">= 0"])
76
67
  s.add_dependency(%q<ci_reporter>, [">= 0"])
77
68
  s.add_dependency(%q<builder>, [">= 0"])
@@ -79,9 +70,9 @@ Gem::Specification.new do |s|
79
70
  else
80
71
  s.add_dependency(%q<xml-simple>, [">= 0"])
81
72
  s.add_dependency(%q<shoulda>, [">= 0"])
82
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
83
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
84
- s.add_dependency(%q<rcov>, [">= 0"])
73
+ s.add_dependency(%q<bundler>, [">= 0"])
74
+ s.add_dependency(%q<jeweler>, [">= 0"])
75
+ s.add_dependency(%q<simplecov>, [">= 0"])
85
76
  s.add_dependency(%q<xml-simple>, [">= 0"])
86
77
  s.add_dependency(%q<ci_reporter>, [">= 0"])
87
78
  s.add_dependency(%q<builder>, [">= 0"])
@@ -7,10 +7,6 @@ require 'openssl'
7
7
  require 'rubygems'
8
8
  require 'xmlsimple'
9
9
 
10
- def require_local(suffix)
11
- require(File.expand_path(File.join(File.dirname(__FILE__), suffix)))
12
- end
13
-
14
10
  module KualiRice
15
11
 
16
12
  attr_accessor :server
@@ -23,14 +19,16 @@ module KualiRice
23
19
  @server = server
24
20
  @use_ssl = false
25
21
  @port = "8080"
26
- @remoting_path = "/kr-dev/remoting"
27
- @headers = ""
22
+ @remoting_path = "/kfs/remoting"
23
+ @headers = nil
28
24
  end
29
25
 
26
+ require 'kuali-rice/KualiRESTInterface'
27
+ require 'kuali-rice/Responses'
28
+
30
29
  end
31
30
 
32
- require_local("/kuali-rice/KualiRESTInterface")
33
- require_local("/kuali-rice/Responses")
31
+
34
32
 
35
33
 
36
34
 
@@ -1,3 +1,3 @@
1
- require_local("kuali-rice/KualiRESTInterface/RestAPI")
2
- require_local("kuali-rice/KualiRESTInterface/DocumentActions")
3
- require_local("kuali-rice/KualiRESTInterface/PersonInterface")
1
+ require 'kuali-rice/KualiRESTInterface/RestAPI'
2
+ require 'kuali-rice/KualiRESTInterface/PersonInterface'
3
+ require 'kuali-rice/KualiRESTInterface/PermissionInterface'
@@ -0,0 +1,11 @@
1
+ module KualiRice
2
+
3
+ class KualiRESTInterface
4
+ include KualiRice
5
+
6
+ def getPrincipalsByPremissionName(perm_nm, nmspc_cd)
7
+ Assignees.new(rest_call("/prinicpalsbypermission/#{perm_nm}/namespace/#{nmspc_cd}")).assignees
8
+ end
9
+ end
10
+
11
+ end
@@ -18,7 +18,7 @@ module KualiRice
18
18
  def getPersonByExternalIdentifier(type, id)
19
19
  Person.new(rest_call("/Person/byexternalid/type/#{type}/id/#{id}"))
20
20
  end
21
-
21
+
22
22
  end
23
23
 
24
24
  end
@@ -11,15 +11,18 @@ module KualiRice
11
11
 
12
12
  path = @remoting_path + path
13
13
  path = URI.escape(path)
14
-
15
- result = http.start { |http|
16
- response, body = (verb.eql?(:post) ? http.post(path, encode_params(post_data), @headers) : http.request_get(path, @headers))
14
+
15
+ puts "#{path}, #{verb}"
16
+
17
+ http.start do |http|
18
+ response = (verb.eql?(:post) ? http.post(path, encode_params(post_data), @headers) : http.request_get(path, @headers))
17
19
 
18
- body
19
- }
20
+ response.body
21
+ end
20
22
  end
21
23
 
22
24
  protected
25
+
23
26
  def encode_params(param_hash)
24
27
  param_hash
25
28
  end
@@ -1,5 +1,2 @@
1
- require_local("kuali-rice/Responses/ErrorResponse")
2
- require_local("kuali-rice/Responses/StandardResponse")
3
- require_local("kuali-rice/Responses/DocumentResponse")
4
- require_local("kuali-rice/Responses/ActionItem")
5
- require_local("kuali-rice/Responses/Person")
1
+ require 'kuali-rice/Responses/Person'
2
+ require 'kuali-rice/Responses/Assignees'
@@ -0,0 +1,32 @@
1
+ module KualiRice
2
+
3
+ class Assignees
4
+
5
+ attr_accessor :assignees
6
+
7
+ def initialize(xmldata="")
8
+ @assignees = Array.new
9
+ add_assigness(xmldata)
10
+ end
11
+
12
+ def add_assigness(xmldata)
13
+ if not xmldata.eql?("") then
14
+ parseddata = XmlSimple.xml_in(xmldata)
15
+ parseddata['assignee'].each do |assignee|
16
+ if !assignee['principalId'].nil?
17
+ @assignees.push(Assignee.new(assignee['principalId'][0]))
18
+ end
19
+ end
20
+
21
+ end
22
+ end
23
+
24
+ class Assignee
25
+ attr_accessor :principalId
26
+
27
+ def initialize(principalId)
28
+ @principalId = principalId
29
+ end
30
+ end
31
+ end
32
+ end
@@ -1,5 +1,8 @@
1
1
  require 'rubygems'
2
2
  require 'bundler'
3
+ require 'simplecov'
4
+ SimpleCov.start
5
+
3
6
  begin
4
7
  Bundler.setup(:default, :development)
5
8
  rescue Bundler::BundlerError => e
@@ -0,0 +1,15 @@
1
+ require 'helper'
2
+
3
+ class TestPermissionInterface < Test::Unit::TestCase
4
+
5
+ def setup
6
+ @ricews = KualiRice::KualiRESTInterface.new
7
+ @ricews.remoting_path += '/RestPermissionService'
8
+ end
9
+
10
+ should "retrieve an array of assigness" do
11
+ assignees = @ricews.getPrincipalsByPremissionName("Initiate Document 117", "KFS-SYS")
12
+ assert assignees.length > 0, "Array should have elements"
13
+ assert_equal "299547", assignees[0].principalId
14
+ end
15
+ end
@@ -9,21 +9,13 @@ class TestPersonInterface < Test::Unit::TestCase
9
9
 
10
10
  should "retrieve a person object by principal name" do
11
11
  person = @ricews.getPersonByPrincipalName("admin")
12
- assert_equal 1100, person.entityId.to_i
12
+ assert_equal 3, person.entityId.to_i
13
13
  end
14
14
 
15
15
  should "retrieve a person object by principal id" do
16
- person = @ricews.getPersonByPrincipalID("admin")
17
- assert_equal 1100, person.entityId.to_i
18
- assert_equal "test@email.edu", person.emailAddress
19
- end
20
-
21
- should "retrieve a person object by emplid" do
22
- person = @ricews.getPersonByEmployeeId("admin")
23
- end
24
-
25
- should "retrieve a person object by external id" do
26
- person = @ricews.getPersonByExternalIdentifier("admin", 1100)
16
+ person = @ricews.getPersonByPrincipalID("3")
17
+ assert_equal 3, person.entityId.to_i
18
+ assert_equal "admin", person.firstName
27
19
  end
28
20
 
29
21
  end
metadata CHANGED
@@ -1,149 +1,135 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: kuali-rice
3
- version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Shawn Bower
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2011-02-01 00:00:00 -05:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- requirement: &id001 !ruby/object:Gem::Requirement
23
- none: false
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- hash: 3
28
- segments:
29
- - 0
30
- version: "0"
31
- type: :runtime
11
+ date: 2013-10-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
32
14
  name: xml-simple
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
33
21
  prerelease: false
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- none: false
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- hash: 3
42
- segments:
43
- - 0
44
- version: "0"
45
- type: :development
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
46
28
  name: shoulda
47
- prerelease: false
48
- version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
50
- requirement: &id003 !ruby/object:Gem::Requirement
51
- none: false
52
- requirements:
53
- - - ~>
54
- - !ruby/object:Gem::Version
55
- hash: 23
56
- segments:
57
- - 1
58
- - 0
59
- - 0
60
- version: 1.0.0
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
61
34
  type: :development
62
- name: bundler
63
35
  prerelease: false
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
66
- requirement: &id004 !ruby/object:Gem::Requirement
67
- none: false
68
- requirements:
69
- - - ~>
70
- - !ruby/object:Gem::Version
71
- hash: 7
72
- segments:
73
- - 1
74
- - 5
75
- - 2
76
- version: 1.5.2
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
77
48
  type: :development
78
- name: jeweler
79
49
  prerelease: false
80
- version_requirements: *id004
81
- - !ruby/object:Gem::Dependency
82
- requirement: &id005 !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- hash: 3
88
- segments:
89
- - 0
90
- version: "0"
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: jeweler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
91
62
  type: :development
92
- name: rcov
93
63
  prerelease: false
94
- version_requirements: *id005
95
- - !ruby/object:Gem::Dependency
96
- requirement: &id006 !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- hash: 3
102
- segments:
103
- - 0
104
- version: "0"
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
105
76
  type: :development
106
- name: xml-simple
107
77
  prerelease: false
108
- version_requirements: *id006
109
- - !ruby/object:Gem::Dependency
110
- requirement: &id007 !ruby/object:Gem::Requirement
111
- none: false
112
- requirements:
113
- - - ">="
114
- - !ruby/object:Gem::Version
115
- hash: 3
116
- segments:
117
- - 0
118
- version: "0"
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: xml-simple
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
119
90
  type: :development
120
- name: ci_reporter
121
91
  prerelease: false
122
- version_requirements: *id007
123
- - !ruby/object:Gem::Dependency
124
- requirement: &id008 !ruby/object:Gem::Requirement
125
- none: false
126
- requirements:
127
- - - ">="
128
- - !ruby/object:Gem::Version
129
- hash: 3
130
- segments:
131
- - 0
132
- version: "0"
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: ci_reporter
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
133
104
  type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
134
112
  name: builder
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
135
119
  prerelease: false
136
- version_requirements: *id008
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
137
125
  description: This gem is used to interface with a RICE install via REST services
138
126
  email: shawn.bower@gmail.com
139
127
  executables: []
140
-
141
128
  extensions: []
142
-
143
- extra_rdoc_files:
129
+ extra_rdoc_files:
144
130
  - LICENSE.txt
145
131
  - README.rdoc
146
- files:
132
+ files:
147
133
  - .document
148
134
  - Gemfile
149
135
  - Gemfile.lock
@@ -154,55 +140,39 @@ files:
154
140
  - kuali-rice.gemspec
155
141
  - lib/kuali-rice.rb
156
142
  - lib/kuali-rice/KualiRESTInterface.rb
157
- - lib/kuali-rice/KualiRESTInterface/DocumentActions.rb
143
+ - lib/kuali-rice/KualiRESTInterface/PermissionInterface.rb
158
144
  - lib/kuali-rice/KualiRESTInterface/PersonInterface.rb
159
145
  - lib/kuali-rice/KualiRESTInterface/RestAPI.rb
160
146
  - lib/kuali-rice/Responses.rb
161
- - lib/kuali-rice/Responses/ActionItem.rb
162
- - lib/kuali-rice/Responses/DocumentResponse.rb
163
- - lib/kuali-rice/Responses/ErrorResponse.rb
147
+ - lib/kuali-rice/Responses/Assignees.rb
164
148
  - lib/kuali-rice/Responses/Person.rb
165
- - lib/kuali-rice/Responses/StandardResponse.rb
166
149
  - support/DocumentFinalFYIRouting.xml
167
150
  - support/RiceWSDocType.xml
168
151
  - test/helper.rb
169
- - test/test_kuali-rice.rb
152
+ - test/test_permission_interface.rb
170
153
  - test/test_person_interface.rb
171
- has_rdoc: true
172
154
  homepage: http://github.com/sbower/kuali-rice
173
- licenses:
155
+ licenses:
174
156
  - MIT
157
+ metadata: {}
175
158
  post_install_message:
176
159
  rdoc_options: []
177
-
178
- require_paths:
160
+ require_paths:
179
161
  - lib
180
- required_ruby_version: !ruby/object:Gem::Requirement
181
- none: false
182
- requirements:
183
- - - ">="
184
- - !ruby/object:Gem::Version
185
- hash: 3
186
- segments:
187
- - 0
188
- version: "0"
189
- required_rubygems_version: !ruby/object:Gem::Requirement
190
- none: false
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- hash: 3
195
- segments:
196
- - 0
197
- version: "0"
162
+ required_ruby_version: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ required_rubygems_version: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - '>='
170
+ - !ruby/object:Gem::Version
171
+ version: '0'
198
172
  requirements: []
199
-
200
173
  rubyforge_project:
201
- rubygems_version: 1.3.7
174
+ rubygems_version: 2.0.6
202
175
  signing_key:
203
- specification_version: 3
176
+ specification_version: 4
204
177
  summary: This gem is used to interface with a RICE install via REST services
205
- test_files:
206
- - test/helper.rb
207
- - test/test_kuali-rice.rb
208
- - test/test_person_interface.rb
178
+ test_files: []
@@ -1,120 +0,0 @@
1
- module KualiRice
2
-
3
- class KualiRESTInterface
4
- include KualiRice
5
-
6
- def ping
7
- rest_call("/ping")
8
- end
9
-
10
- def getDocument(docid, userid)
11
- DocumentResponse.new(rest_call("/doc/getdocument/userID/#{userid}/docid/#{docid}"))
12
- end
13
-
14
- def create(initiatorId, appDocId, docType, docTitle)
15
- DocumentResponse.new(rest_call("/doc/create/initiatorID/#{initiatorId}/appid/#{appDocId}/type/#{docType}/title/#{docTitle}", :post))
16
- end
17
-
18
- def save(docid, userID, docTitle, annotation)
19
- StandardResponse.new(rest_call("/doc/save/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
20
- end
21
-
22
- def acknowledge(docid, userID, annotation)
23
- StandardResponse.new(rest_call("/doc/acknowledge/userID/#{userID}/docid/#{docid}/annotation/#{annotation}", :post))
24
- end
25
-
26
- def approve(docid, userID, docTitle, annotation)
27
- StandardResponse.new(rest_call("/doc/approve/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
28
- end
29
-
30
- def blanketApprove(docid, userID, docTitle, annotation)
31
- StandardResponse.new(rest_call("/doc/blanketApprove/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
32
- end
33
-
34
- def cancel(docid, userID, annotation)
35
- StandardResponse.new(rest_call("/doc/cancel/userID/#{userID}/docid/#{docid}/annotation/#{annotation}", :post))
36
- end
37
-
38
- def disapprove(docid, userID, annotation)
39
- StandardResponse.new(rest_call("/doc/disapprove/userID/#{userID}/docid/#{docid}/annotation/#{annotation}", :post))
40
- end
41
-
42
- def fyi(docid, userID)
43
- StandardResponse.new(rest_call("/doc/fyi/userID/#{userID}/docid/#{docid}", :post))
44
- end
45
-
46
- def route(docid, userID, docTitle, annotation)
47
- StandardResponse.new(rest_call("/doc/route/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
48
- end
49
-
50
- def requestAdHocAckToGroup(docid, userID, recipientGroupId, annotation)
51
- StandardResponse.new(rest_call("/doc/requestAdHocAckToGroup/userID/#{userID}/docid/#{docid}/recipientgroupid/#{recipientGroupId}/annotation/#{annotation}", :post))
52
- end
53
-
54
- def requestAdHocAckToUser(docid, userID, recipientId, annotation)
55
- StandardResponse.new(rest_call("/doc/requestAdHocAckToUser/userID/#{userID}/docid/#{docid}/recipientid/#{recipientId}/annotation/#{annotation}", :post))
56
- end
57
-
58
- def requestAdHocApproveToGroup(docid, userID, recipientGroupId, annotation)
59
- StandardResponse.new(rest_call("/doc/requestAdHocApproveToGroup/userID/#{userID}/docid/#{docid}/recipientgroupid/#{recipientGroupId}/annotation/#{annotation}", :post))
60
- end
61
-
62
- def requestAdHocApproveToUser(docid, userID, recipientId, annotation)
63
- StandardResponse.new(rest_call("/doc/requestAdHocApproveToUser/userID/#{userID}/docid/#{docid}/recipientid/#{recipientId}/annotation/#{annotation}", :post))
64
- end
65
-
66
- def requestAdHocFyiToGroup(docid, userID, recipientGroupId, annotation)
67
- StandardResponse.new(rest_call("/doc/requestAdHocFyiToGroup/userID/#{userID}/docid/#{docid}/recipientgroupid/#{recipientGroupId}/annotation/#{annotation}", :post))
68
- end
69
-
70
- def requestAdHocFyiToUser(docid, userID, recipientId, annotation)
71
- StandardResponse.new(rest_call("/doc/requestAdHocFyiToUser/userID/#{userID}/docid/#{docid}/recipientid/#{recipientId}/annotation/#{annotation}", :post))
72
- end
73
-
74
- def isUserInRouteLog(docid, userID)
75
- xmldata = rest_call("/doc/isUserInRouteLog/userID/#{userID}/docid/#{docid}")
76
- parseddata = XmlSimple.xml_in(xmldata)
77
-
78
- if(parseddata['isUserInRouteLog'][0].eql?("true")) then
79
- return true
80
- end
81
-
82
- return false
83
- end
84
-
85
- def getUserInbox(userID)
86
- createActionList(rest_call("/actionitems/getinbox/#{userID}"))
87
- end
88
-
89
- def countUserInboxItems(userID)
90
- rest_call("/actionitems/countinbox/#{userID}")
91
- end
92
-
93
- def findByRouteHeaderId(routeHeaderIdStr)
94
- createActionList(rest_call("/actionitems/findbyrouteheader/#{routeHeaderIdStr}"))
95
- end
96
-
97
- def sendNotification(message)
98
- rest_call("/notification/send/", :post, message)
99
- end
100
-
101
- private
102
-
103
- def createActionList(xmldata)
104
- parseddata = XmlSimple.xml_in(xmldata)
105
- actionItems = Array.new
106
-
107
- if !parseddata['ActionItem'].nil? then
108
- parseddata['ActionItem'].each do |item|
109
- newactionitem = ActionItem.new(XmlSimple.xml_out(item))
110
- actionItems.push(newactionitem)
111
- end
112
- end
113
-
114
- actionItems
115
- end
116
-
117
-
118
-
119
- end
120
- end
@@ -1,48 +0,0 @@
1
- module KualiRice
2
-
3
- class ActionItem
4
- attr_accessor :delegatorName
5
- attr_accessor :isInitialized
6
- attr_accessor :actionItemId
7
- attr_accessor :principalId
8
- attr_accessor :dateAssigned
9
- attr_accessor :actionRequestCd
10
- attr_accessor :actionRequestId
11
- attr_accessor :routeHeaderId
12
- attr_accessor :docTitle
13
- attr_accessor :docLabel
14
- attr_accessor :docHandlerURL
15
- attr_accessor :lockVerNbr
16
- attr_accessor :docName
17
- attr_accessor :responsibilityId
18
- attr_accessor :customActions
19
-
20
- def initialize(xmldata="")
21
- setActionItem(xmldata)
22
- end
23
-
24
- def setActionItem(xmldata)
25
- if not xmldata.eql?("") then
26
- parseddata = XmlSimple.xml_in(xmldata)
27
-
28
- @delegatorName = parseddata['delegatorName'][0] if !parseddata['delegatorName'].nil?
29
- @isInitialized = parseddata['isInitialized'][0] if !parseddata['isInitialized'].nil?
30
- @actionItemId = parseddata['actionItemId'][0] if !parseddata['actionItemId'].nil?
31
- @principalId = parseddata['principalId'][0] if !parseddata['principalId'].nil?
32
- @dateAssigned = parseddata['dateAssigned'][0] if !parseddata['dateAssigned'].nil?
33
- @actionRequestCd = parseddata['actionRequestCd'][0] if !parseddata['actionRequestCd'].nil?
34
- @actionRequestId = parseddata['actionRequestId'][0] if !parseddata['actionRequestId'].nil?
35
- @routeHeaderId = parseddata['routeHeaderId'][0] if !parseddata['routeHeaderId'].nil?
36
- @docTitle = parseddata['docTitle'][0] if !parseddata['docTitle'].nil?
37
- @docLabel = parseddata['docLabel'][0] if !parseddata['docLabel'].nil?
38
- @docHandlerURL = parseddata['docHandlerURL'][0] if !parseddata['docHandlerURL'].nil?
39
- @lockVerNbr = parseddata['lockVerNbr'][0] if !parseddata['lockVerNbr'].nil?
40
- @docName = parseddata['docName'][0] if !parseddata['docName'].nil?
41
- @responsibilityId = parseddata['responsibilityId'][0] if !parseddata['responsibilityId'].nil?
42
- @customActions = parseddata['customActions'][0] if !parseddata['customActions'].nil?
43
-
44
- end
45
- end
46
- end
47
-
48
- end
@@ -1,36 +0,0 @@
1
- module KualiRice
2
-
3
- class DocumentResponse < StandardResponse
4
-
5
- attr_accessor :docId
6
- attr_accessor :docContent
7
- attr_accessor :title
8
- attr_accessor :notes
9
- attr_accessor :actionRequested
10
-
11
- def initialize(xmldata="")
12
- setDocumentResponse(xmldata)
13
- end
14
-
15
- def setDocumentResponse(xmldata)
16
- if not xmldata.eql?("") then
17
- parseddata = XmlSimple.xml_in(xmldata)
18
-
19
- @docId = parseddata['docId'][0] if !parseddata['docId'].nil?
20
- @docContent = parseddata['docContent'][0] if !parseddata['docContent'].nil?
21
- @title = parseddata['title'][0] if !parseddata['title'].nil?
22
- @actionRequested = parseddata['actionRequested'][0] if !parseddata['actionRequested'].nil?
23
- @docStatus = parseddata['docStatus'][0] if !parseddata['docStatus'].nil?
24
- @createDate = parseddata['createDate'][0] if !parseddata['createDate'].nil?
25
- @initiatorPrincipalId = parseddata['initiatorPrincipalId'][0] if !parseddata['initiatorPrincipalId'].nil?
26
- @routedByPrincipalId = parseddata['routedByPrincipalId'][0] if !parseddata['routedByPrincipalId'].nil?
27
- @routedByUserName = parseddata['routedByUserName'][0] if !parseddata['routedByUserName'].nil?
28
- @appDocId = parseddata['appDocId'][0] if !parseddata['appDocId'].nil?
29
- @initiatorName = parseddata['initiatorName'][0] if !parseddata['initiatorName'].nil?
30
- @errorMessage = parseddata['errorMessage'][0] if !parseddata['errorMessage'].nil?
31
- end
32
- end
33
-
34
- end
35
-
36
- end
@@ -1,9 +0,0 @@
1
- module KualiRice
2
-
3
- class ErrorResponse
4
-
5
- attr_accessor :errorMessage
6
-
7
- end
8
-
9
- end
@@ -1,35 +0,0 @@
1
- module KualiRice
2
-
3
- class StandardResponse < ErrorResponse
4
-
5
- attr_accessor :docStatus
6
- attr_accessor :createDate
7
- attr_accessor :initiatorPrincipalId
8
- attr_accessor :routedByPrincipalId
9
- attr_accessor :routedByUserName
10
- attr_accessor :appDocId
11
- attr_accessor :initiatorName
12
-
13
- def initialize(xmldata="")
14
- setStandardResponse(xmldata)
15
- end
16
-
17
- def setStandardResponse(xmldata)
18
- if not xmldata.eql?("") then
19
- parseddata = XmlSimple.xml_in(xmldata)
20
-
21
- @docStatus = parseddata['docStatus'][0] if !parseddata['docStatus'].nil?
22
- @createDate = parseddata['createDate'][0] if !parseddata['createDate'].nil?
23
- @initiatorPrincipalId = parseddata['initiatorPrincipalId'][0] if !parseddata['initiatorPrincipalId'].nil?
24
- @routedByPrincipalId = parseddata['routedByPrincipalId'][0] if !parseddata['routedByPrincipalId'].nil?
25
- @routedByUserName = parseddata['routedByUserName'][0] if !parseddata['routedByUserName'].nil?
26
- @appDocId = parseddata['appDocId'][0] if !parseddata['appDocId'].nil?
27
- @initiatorName = parseddata['initiatorName'][0] if !parseddata['initiatorName'].nil?
28
- @errorMessage = parseddata['errorMessage'][0] if !parseddata['errorMessage'].nil?
29
-
30
- end
31
- end
32
-
33
- end
34
-
35
- end
@@ -1,254 +0,0 @@
1
- require 'helper'
2
-
3
- class TestKualiRice < Test::Unit::TestCase
4
-
5
- def setup
6
- @ricews = KualiRice::KualiRESTInterface.new
7
- @ricews.remoting_path += '/simpleDocAction'
8
-
9
- document = @ricews.create("user4", "0", "RiceWSTest", "TestTitle")
10
-
11
- @createdDocId = document.docId
12
- end
13
-
14
- should "create new interface object" do
15
- assert_equal @ricews.use_ssl, false
16
- end
17
-
18
- should "ping server" do
19
- ping = @ricews.ping
20
- assert_equal "PING: kr-dev", ping
21
- end
22
-
23
- should "create document" do
24
- document = @ricews.create("user1", "1", "eDoc.Example1Doctype", "TestTitle")
25
- assert_equal "TestTitle", document.title
26
- assert_equal "One, User", document.initiatorName
27
- assert_equal "1", document.appDocId
28
- end
29
-
30
- should "get document" do
31
- document = @ricews.getDocument( @createdDocId, "user4")
32
- assert_equal "TestTitle", document.title
33
- assert_equal "I", document.docStatus
34
- end
35
-
36
- should "save document" do
37
- document = @ricews.save(@createdDocId, "user4", "TestTitle", "SavingDoc")
38
- assert_equal "S", document.docStatus
39
- assert_equal "user4, user4", document.initiatorName
40
- end
41
-
42
- should "cancel document" do
43
- document = @ricews.cancel(@createdDocId, "user4", "CancelDoc")
44
- assert_equal "X", document.docStatus
45
- assert_equal "user4, user4", document.initiatorName
46
- end
47
-
48
- should "fyi document" do
49
- document = @ricews.fyi(@createdDocId, "user3")
50
- document = @ricews.route(@createdDocId, "user4", "TestTitle", "RouteDoc ")
51
-
52
- #assert_equal "X", document.docStatus
53
- assert_equal "user4, user4", document.initiatorName
54
- end
55
-
56
- should "route document" do
57
- document = @ricews.route(@createdDocId, "user4", "TestTitle", "RouteDoc")
58
- assert_equal "R", document.docStatus
59
- assert_equal "user4, user4", document.initiatorName
60
-
61
- sleep(1)
62
- document = @ricews.getDocument( @createdDocId, "user2")
63
- assert_equal "APPROVE", document.actionRequested
64
- end
65
-
66
- should "approve document, should go final" do
67
- @ricews.save(@createdDocId, "user4", "TestTitle", "SavingDoc")
68
- @ricews.route(@createdDocId, "user4", "TestTitle", "SavingDoc")
69
- @ricews.approve(@createdDocId, "user2", "TestTitle", "ApproveDoc")
70
-
71
- sleep(1)
72
- document = @ricews.getDocument( @createdDocId, "user4")
73
- assert_equal "F", document.docStatus
74
- assert_not_same "APPROVE", document.actionRequested
75
- end
76
-
77
- should "disapprove document, should go final" do
78
- @ricews.save(@createdDocId, "user4", "TestTitle", "SavingDoc")
79
- @ricews.route(@createdDocId, "user4", "TestTitle", "SavingDoc")
80
- @ricews.disapprove(@createdDocId, "user2", "ApproveDoc")
81
-
82
- sleep(1)
83
- document = @ricews.getDocument( @createdDocId, "user4")
84
- assert_equal "D", document.docStatus
85
- assert_not_same "APPROVE", document.actionRequested
86
- end
87
-
88
- should "set ad hoc route to user2" do
89
- @ricews.requestAdHocApproveToUser(@createdDocId, "user4", "user2", "AdHocDoc")
90
- @ricews.save(@createdDocId, "user4", "TestTitle", "SavingDoc")
91
-
92
- document = @ricews.getDocument( @createdDocId, "user2")
93
- assert_not_same "APPROVE", document.actionRequested
94
- assert_equal "S", document.docStatus
95
-
96
- @ricews.approve(@createdDocId, "user1", "TestTitle", "ApproveDoc")
97
-
98
- document = @ricews.getDocument( @createdDocId, "user2")
99
- assert_equal "APPROVE", document.actionRequested
100
- assert_equal "R", document.docStatus
101
- end
102
-
103
- should "set ad hoc route to WorkflowAdmin" do
104
- @ricews.requestAdHocApproveToGroup(@createdDocId, "user4", "1", "AdHocDoc")
105
- @ricews.save(@createdDocId, "user4", "TestTitle", "SavingDoc")
106
-
107
- document = @ricews.getDocument( @createdDocId, "admin")
108
- assert_not_same "APPROVE", document.actionRequested
109
- assert_equal "S", document.docStatus
110
-
111
- @ricews.approve(@createdDocId, "user1", "TestTitle", "ApproveDoc")
112
-
113
- document = @ricews.getDocument( @createdDocId, "admin")
114
- assert_equal "APPROVE", document.actionRequested
115
- assert_equal "R", document.docStatus
116
- end
117
-
118
- should "send adhoc fyi to user3" do
119
- @ricews.requestAdHocFyiToUser(@createdDocId, "user4", "user3", "FYI")
120
- @ricews.route(@createdDocId, "user4", "TestTitle", "SavingDoc")
121
-
122
- sleep(1)
123
- document = @ricews.getDocument( @createdDocId, "user3")
124
- assert_equal "FYI", document.actionRequested
125
- assert_equal "R", document.docStatus
126
-
127
- document = @ricews.fyi( @createdDocId, "user3")
128
- document = @ricews.getDocument( @createdDocId, "user3")
129
-
130
- assert_not_same "FYI", document.actionRequested
131
- assert_equal "R", document.docStatus
132
- end
133
-
134
- should "send adhoc fyi to WorkflowAdmin" do
135
- @ricews.requestAdHocFyiToGroup(@createdDocId, "user4", "1", "FYI")
136
- @ricews.route(@createdDocId, "user4", "TestTitle", "SavingDoc")
137
-
138
- sleep(1)
139
- document = @ricews.getDocument( @createdDocId, "admin")
140
- assert_equal "FYI", document.actionRequested
141
- assert_equal "R", document.docStatus
142
-
143
- document = @ricews.fyi( @createdDocId, "admin")
144
- document = @ricews.getDocument( @createdDocId, "admin")
145
-
146
- assert_not_same "FYI", document.actionRequested
147
- assert_equal "R", document.docStatus
148
- end
149
-
150
- should "send adhoc acknowledge to user3" do
151
- @ricews.requestAdHocAckToUser(@createdDocId, "user4", "user3", "ACK")
152
- @ricews.route(@createdDocId, "user4", "TestTitle", "RouteDoc")
153
-
154
- sleep(1)
155
- document = @ricews.getDocument( @createdDocId, "user3")
156
- assert_equal "ACKNOWLEDGE", document.actionRequested
157
- assert_equal "R", document.docStatus
158
-
159
- @ricews.acknowledge(@createdDocId, "user3", "ACK")
160
- document = @ricews.getDocument( @createdDocId, "user3")
161
-
162
- assert_not_same "ACKNOWLEDGE", document.actionRequested
163
- assert_equal "R", document.docStatus
164
- end
165
-
166
- should "send adhoc acknowledge to group WorkflowAdmin" do
167
- @ricews.requestAdHocAckToGroup(@createdDocId, "user4", "1", "ACK")
168
- @ricews.route(@createdDocId, "user4", "TestTitle", "RouteDoc")
169
-
170
- sleep(1)
171
- document = @ricews.getDocument( @createdDocId, "admin")
172
- assert_equal "ACKNOWLEDGE", document.actionRequested
173
- assert_equal "R", document.docStatus
174
-
175
- @ricews.acknowledge(@createdDocId, "admin", "ACK")
176
- document = @ricews.getDocument( @createdDocId, "admin")
177
-
178
- assert_not_same "ACKNOWLEDGE", document.actionRequested
179
- assert_equal "R", document.docStatus
180
- end
181
-
182
- should "blanket approve document, should go PROCESSED awaiting ack from user1, user2" do
183
- @ricews.requestAdHocApproveToUser(@createdDocId, "user1", "user2", "AdHocDoc")
184
- @ricews.requestAdHocApproveToUser(@createdDocId, "user1", "admin", "AdHocDoc")
185
- @ricews.save(@createdDocId, "user1", "TestTitle", "SavingDoc")
186
-
187
- document = @ricews.blanketApprove(@createdDocId, "user1", "TestTitle", "ApproveDoc")
188
- assert_equal "Workflow Error: User is not authorized to BlanketApprove document", document.errorMessage
189
-
190
- @ricews.blanketApprove(@createdDocId, "admin", "TestTitle", "ApproveDoc")
191
-
192
- document = @ricews.getDocument( @createdDocId, "admin")
193
- assert_match /[R|P]/, document.docStatus
194
- assert_not_same "APPROVE", document.actionRequested
195
- end
196
-
197
- should "chack to see if user is in route log" do
198
- document = @ricews.route(@createdDocId, "user4", "TestTitle", "RouteDoc")
199
- assert_equal "R", document.docStatus
200
- assert_equal "user4, user4", document.initiatorName
201
-
202
- assert(@ricews.isUserInRouteLog(@createdDocId, "user2"))
203
- assert_equal false, @ricews.isUserInRouteLog(@createdDocId, "user3")
204
- end
205
-
206
- should "get user's inbox" do
207
- action_list = @ricews.getUserInbox("admin")
208
-
209
- action_list.each do |actionItem|
210
- assert_equal "admin", actionItem.principalId
211
- end
212
-
213
- end
214
-
215
- should "action list by route header" do
216
- @ricews.requestAdHocAckToUser(@createdDocId, "user4", "user3", "ACK")
217
- @ricews.route(@createdDocId, "user4", "TestTitle", "RouteDoc")
218
-
219
- sleep(1)
220
- action_list = @ricews.findByRouteHeaderId(@createdDocId)
221
- num = 0
222
-
223
- action_list.each do |actionItem|
224
- num += 1
225
-
226
- if actionItem.principalId.eql?("user3") then
227
- assert_equal "K", actionItem.actionRequestCd
228
- end
229
- end
230
-
231
- assert_equal 4, num
232
-
233
- end
234
-
235
- should "get user's inbox action Item count" do
236
- action_list = @ricews.getUserInbox("admin")
237
- num = 0
238
-
239
- action_list.each do |actionItem|
240
- num += 1
241
- end
242
-
243
- count = @ricews.countUserInboxItems("admin")
244
- assert_equal num, count.to_i
245
-
246
- end
247
-
248
- should "Create a long annotation with spaces" do
249
- document = @ricews.save(@createdDocId, "user4", "TestTitle", "This is a long annotation with many awesome spaces")
250
- assert_equal "S", document.docStatus
251
- assert_equal "user4, user4", document.initiatorName
252
- end
253
-
254
- end