openagent 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/openagent/client.rb +10 -14
- data/lib/openagent/version.rb +1 -1
- data/lib/sif/infra/common/message.rb +15 -0
- data/lib/sif/models/common/schedule_info.rb +1 -1
- data/lib/sif/models/common/school_course_info_override.rb +1 -1
- data/lib/sif/models/common/street.rb +1 -0
- data/lib/sif/models/groups/sis/personal_representer.rb +1 -1
- data/lib/sif/models/groups/sis/school_course_info.rb +2 -2
- data/lib/sif/models/groups/sis/section_info.rb +3 -1
- data/lib/sif/representations/models/common/school_course_info_override.rb +2 -2
- data/lib/sif/representations/models/groups/sis/school_course_info.rb +2 -2
- data/lib/sif/representations/models/groups/sis/section_info.rb +1 -1
- data/spec/fixtures/sif/school_course_info.xml +21 -0
- data/spec/fixtures/sif/section_info.xml +94 -1536
- data/spec/fixtures/sif/staff_personal.xml +44 -0
- data/spec/sif/representations/xml/school_course_info_spec.rb +29 -0
- data/spec/sif/representations/xml/section_info_spec.rb +61 -0
- data/spec/sif/representations/xml/staff_personal_spec.rb +105 -0
- data/spec/sif/representations/xml/student_personal_spec.rb +97 -59
- metadata +12 -2
data/lib/openagent/client.rb
CHANGED
@@ -91,35 +91,31 @@ module OpenAgent
|
|
91
91
|
wait_period = wait_long
|
92
92
|
messages_in_queue = true
|
93
93
|
while messages_in_queue
|
94
|
-
get_message do |
|
95
|
-
|
96
|
-
|
94
|
+
get_message do |message|
|
95
|
+
if inner = message.inner_message
|
96
|
+
trigger(:receive_message, message)
|
97
97
|
|
98
|
-
|
99
|
-
|
100
|
-
trigger(:receive_message, wrap_msg, http_response)
|
101
|
-
|
102
|
-
if message.response
|
103
|
-
case status_code
|
98
|
+
if inner.response
|
99
|
+
case message.status_code
|
104
100
|
when ZIS_SUCCESS then
|
105
|
-
if
|
101
|
+
if inner.response.more_packets?
|
106
102
|
wait_period = wait_short
|
107
103
|
else
|
108
104
|
wait_period = wait_long
|
109
105
|
end
|
110
106
|
when ZIS_NO_MESSAGES then
|
111
|
-
if not
|
107
|
+
if not inner.more_packets?
|
112
108
|
wait_period = wait_long
|
113
109
|
end
|
114
110
|
end
|
115
111
|
end
|
116
112
|
|
117
113
|
# We send an Ack for both an Event and a Response
|
118
|
-
if status_code == ZIS_SUCCESS
|
119
|
-
ack(
|
114
|
+
if message.status_code == ZIS_SUCCESS
|
115
|
+
ack(inner.source_id, inner.msg_id)
|
120
116
|
end
|
121
117
|
else
|
122
|
-
if status_code == ZIS_NO_MESSAGES
|
118
|
+
if message.status_code == ZIS_NO_MESSAGES
|
123
119
|
messages_in_queue = false
|
124
120
|
end
|
125
121
|
end
|
data/lib/openagent/version.rb
CHANGED
@@ -25,11 +25,13 @@ module SIF
|
|
25
25
|
rescue NoMethodError
|
26
26
|
nil
|
27
27
|
end
|
28
|
+
|
28
29
|
def response_objects
|
29
30
|
inner_message.response.object_data.objects
|
30
31
|
rescue NoMethodError
|
31
32
|
nil
|
32
33
|
end
|
34
|
+
|
33
35
|
def type
|
34
36
|
if event then :event else :response end
|
35
37
|
end
|
@@ -40,9 +42,22 @@ module SIF
|
|
40
42
|
system_control || unprovide || unregister || unsubscribe
|
41
43
|
end
|
42
44
|
|
45
|
+
def source_id
|
46
|
+
content && content.header.source_id
|
47
|
+
end
|
48
|
+
|
43
49
|
def msg_id
|
44
50
|
content && content.header.msg_id
|
45
51
|
end
|
52
|
+
|
53
|
+
def timestamp
|
54
|
+
content && content.header.timestamp
|
55
|
+
end
|
56
|
+
|
57
|
+
def status_code
|
58
|
+
ack && ack.status.code
|
59
|
+
end
|
60
|
+
|
46
61
|
end
|
47
62
|
end
|
48
63
|
end
|
@@ -13,6 +13,7 @@ module SIF
|
|
13
13
|
attribute :street_name, String
|
14
14
|
attribute :street_type, String
|
15
15
|
attribute :street_suffix, String
|
16
|
+
attribute :apartment_type, String
|
16
17
|
attribute :apartment_number_prefix, String
|
17
18
|
attribute :apartment_number, String
|
18
19
|
attribute :apartment_number_suffix, String
|
@@ -11,7 +11,7 @@ module SIF
|
|
11
11
|
attribute :electronic_ids, Array[MODEL_COMMON::ElectronicId]
|
12
12
|
attribute :other_ids, Array[MODEL_COMMON::OtherId]
|
13
13
|
attribute :other_names, String
|
14
|
-
attribute :demographics,
|
14
|
+
attribute :demographics, MODEL_COMMON::Demographics
|
15
15
|
attribute :addresses, Array[MODEL_COMMON::Address]
|
16
16
|
attribute :phone_numbers, Array[MODEL_COMMON::PhoneNumber]
|
17
17
|
attribute :emails, Array[MODEL_COMMON::Email]
|
@@ -8,7 +8,7 @@ module SIF
|
|
8
8
|
include Virtus.model
|
9
9
|
include SISRepresenter
|
10
10
|
|
11
|
-
attribute :
|
11
|
+
attribute :school_course_info_ref_id, String
|
12
12
|
attribute :school_year, String
|
13
13
|
attribute :course_code, String
|
14
14
|
attribute :state_course_code, String
|
@@ -16,7 +16,7 @@ module SIF
|
|
16
16
|
attribute :subject_areas, Array[Common::SubjectArea]
|
17
17
|
attribute :course_title, String
|
18
18
|
attribute :description, String
|
19
|
-
attribute :
|
19
|
+
attribute :instructional_level, String
|
20
20
|
attribute :course_credits, String
|
21
21
|
attribute :core_academic_course, String
|
22
22
|
attribute :graduation_requirement, String
|
@@ -8,7 +8,9 @@ module SIF
|
|
8
8
|
include Virtus.model
|
9
9
|
include SISRepresenter
|
10
10
|
|
11
|
-
|
11
|
+
include SISRepresenter
|
12
|
+
|
13
|
+
attribute :school_course_info_ref_id, String
|
12
14
|
attribute :school_year, String
|
13
15
|
attribute :local_id, String
|
14
16
|
attribute :description, String
|
@@ -8,11 +8,11 @@ module SIF
|
|
8
8
|
|
9
9
|
property :override, :as => 'Override', :attribute => true
|
10
10
|
property :course_code, :as => 'CourseCode'
|
11
|
-
property :
|
11
|
+
property :state_course_code, :as => 'StateCourseCode'
|
12
12
|
property :district_course_code, :as => 'DistrictCourseCode'
|
13
13
|
property :subject_area, :as => 'SubjectArea'
|
14
14
|
property :course_title, :as => 'CourseTitle'
|
15
|
-
property :
|
15
|
+
property :instructional_level, :as => 'InstructionalLevel'
|
16
16
|
property :course_credits, :as => 'CourseCredits'
|
17
17
|
end
|
18
18
|
end
|
@@ -10,7 +10,7 @@ module SIF
|
|
10
10
|
|
11
11
|
self.representation_wrap = 'SchoolCourseInfo'
|
12
12
|
|
13
|
-
property :
|
13
|
+
property :school_info_ref_id, :attribute => true, :as => 'SchoolInfoRefId'
|
14
14
|
property :school_year, :attribute => true, :as => 'SchoolYear'
|
15
15
|
property :course_code, :as => 'CourseCode'
|
16
16
|
property :state_course_code, :as => 'StateCourseCode'
|
@@ -20,7 +20,7 @@ module SIF
|
|
20
20
|
:decorator => REPR_COMMON::SubjectArea
|
21
21
|
property :course_title, :as => 'CourseTitle'
|
22
22
|
property :description, :as => 'Description'
|
23
|
-
property :
|
23
|
+
property :instructional_level, :as => 'InstructionalLevel'
|
24
24
|
property :course_credits, :as => 'CourseCredits'
|
25
25
|
property :core_academic_course, :as => 'CoreAcademicCourse'
|
26
26
|
property :graduation_requirement, :as => 'GraduationRequirement'
|
@@ -7,7 +7,7 @@ module SIF
|
|
7
7
|
include SISRepresenter
|
8
8
|
self.representation_wrap = 'SectionInfo'
|
9
9
|
|
10
|
-
property :
|
10
|
+
property :school_course_info_ref_id, :attribute => true, :as => 'SchoolCourseInfoRefId'
|
11
11
|
property :school_year, :attribute => true, :as => 'SchoolYear'
|
12
12
|
property :local_id, :as => 'LocalId'
|
13
13
|
property :description, :as => 'Description'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<SchoolCourseInfo RefId="9D75101A8C3D00AA001A0000A2E35B35" SchoolInfoRefId="101A8C3D00AA001A0000A2E35B359D75" SchoolYear="2006">
|
2
|
+
<CourseCode>CS101</CourseCode>
|
3
|
+
<StateCourseCode>08-001</StateCourseCode>
|
4
|
+
<DistrictCourseCode>CS101</DistrictCourseCode>
|
5
|
+
<SubjectAreaList>
|
6
|
+
<SubjectArea>
|
7
|
+
<Code>05</Code>
|
8
|
+
<OtherCodeList>
|
9
|
+
<OtherCode Codeset="Text">Graphic Arts</OtherCode>
|
10
|
+
</OtherCodeList>
|
11
|
+
</SubjectArea>
|
12
|
+
</SubjectAreaList>
|
13
|
+
<CourseTitle>Gif, JPeg, or Png: What's the Difference?</CourseTitle>
|
14
|
+
<Description>Explore the various types of files related to graphic arts.</Description>
|
15
|
+
<InstructionalLevel>
|
16
|
+
<Code>0571</Code>
|
17
|
+
</InstructionalLevel>
|
18
|
+
<CourseCredits Type="0585">2</CourseCredits>
|
19
|
+
<CoreAcademicCourse>No</CoreAcademicCourse>
|
20
|
+
<GraduationRequirement>No</GraduationRequirement>
|
21
|
+
</SchoolCourseInfo>
|