openagent 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 |http_response, doc, status_code|
95
- wrap_msg = Message.new
96
- MessageRepresenter.new(wrap_msg).from_xml(http_response.body)
94
+ get_message do |message|
95
+ if inner = message.inner_message
96
+ trigger(:receive_message, message)
97
97
 
98
- if message = wrap_msg.inner_message
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 message.response.morepackets?
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 message.morepackets?
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(message.sourceid, message.msgid)
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
@@ -1,3 +1,3 @@
1
1
  module OpenAgent
2
- VERSION = '0.7.1' unless defined?(OpenAgent::VERSION)
2
+ VERSION = '0.7.2' unless defined?(OpenAgent::VERSION)
3
3
  end
@@ -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
@@ -7,7 +7,7 @@ module SIF
7
7
  attribute :term_info_ref_id
8
8
  attribute :teachers, Array[String]
9
9
  attribute :section_rooms, Array[String]
10
- attribute :meeting_times, Array[String]
10
+ attribute :meeting_times, Array[MODEL_COMMON::MeetingTime]
11
11
  end
12
12
  end
13
13
  end
@@ -10,7 +10,7 @@ module SIF
10
10
  attribute :district_course_code
11
11
  attribute :subject_area
12
12
  attribute :course_title
13
- attribute :instruction_level
13
+ attribute :instructional_level
14
14
  attribute :course_credits
15
15
  end
16
16
  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, Array[MODEL_COMMON::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 :school_info_id, String
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 :instruction_level, String
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
- attribute :school_course_info, String
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 :state_courase_code, :as => 'StateCourseCode'
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 :instruction_level, :as => 'InstructionLevel'
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 :school_info_id, :attribute => true, :as => 'SchoolInfoId'
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 :instruction_level, :as => 'InstructionLevel'
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 :school_course_info, :attribute => true, :as => 'SchoolCourseInfoRefId'
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>