openagent 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +64 -0
- data/lib/openagent.rb +4 -0
- data/lib/openagent/agent.rb +24 -0
- data/lib/openagent/client.rb +170 -0
- data/lib/openagent/errors.rb +30 -0
- data/lib/openagent/message_builder.rb +171 -0
- data/lib/openagent/ssl_config.rb +26 -0
- data/lib/openagent/version.rb +3 -0
- data/lib/openagent/xml_helpers.rb +24 -0
- data/lib/openagent/zone.rb +58 -0
- data/lib/sif/infra/common/application.rb +13 -0
- data/lib/sif/infra/common/condition.rb +13 -0
- data/lib/sif/infra/common/condition_group.rb +14 -0
- data/lib/sif/infra/common/data.rb +11 -0
- data/lib/sif/infra/common/error.rb +14 -0
- data/lib/sif/infra/common/event.rb +0 -0
- data/lib/sif/infra/common/event_object.rb +12 -0
- data/lib/sif/infra/common/extended_query.rb +15 -0
- data/lib/sif/infra/common/extended_query_results.rb +12 -0
- data/lib/sif/infra/common/header.rb +27 -0
- data/lib/sif/infra/common/message.rb +49 -0
- data/lib/sif/infra/common/object.rb +11 -0
- data/lib/sif/infra/common/object_data.rb +46 -0
- data/lib/sif/infra/common/other_id.rb +12 -0
- data/lib/sif/infra/common/property.rb +12 -0
- data/lib/sif/infra/common/protocol.rb +16 -0
- data/lib/sif/infra/common/provision.rb +17 -0
- data/lib/sif/infra/common/query.rb +16 -0
- data/lib/sif/infra/common/query_object.rb +12 -0
- data/lib/sif/infra/common/secure_channel.rb +12 -0
- data/lib/sif/infra/common/security.rb +13 -0
- data/lib/sif/infra/common/status.rb +16 -0
- data/lib/sif/infra/common/unprovision.rb +9 -0
- data/lib/sif/infra/common/vendor.rb +13 -0
- data/lib/sif/infra/messages/ack.rb +16 -0
- data/lib/sif/infra/messages/event.rb +12 -0
- data/lib/sif/infra/messages/get_agent_acl.rb +11 -0
- data/lib/sif/infra/messages/get_message.rb +11 -0
- data/lib/sif/infra/messages/get_zone_status.rb +10 -0
- data/lib/sif/infra/messages/ping.rb +10 -0
- data/lib/sif/infra/messages/provide.rb +16 -0
- data/lib/sif/infra/messages/provision.rb +18 -0
- data/lib/sif/infra/messages/register.rb +21 -0
- data/lib/sif/infra/messages/request.rb +16 -0
- data/lib/sif/infra/messages/responder.rb +9 -0
- data/lib/sif/infra/messages/response.rb +18 -0
- data/lib/sif/infra/messages/sleep.rb +11 -0
- data/lib/sif/infra/messages/subscribe.rb +12 -0
- data/lib/sif/infra/messages/system_control.rb +15 -0
- data/lib/sif/infra/messages/system_control_data.rb +39 -0
- data/lib/sif/infra/messages/unprovide.rb +12 -0
- data/lib/sif/infra/messages/unregister.rb +11 -0
- data/lib/sif/infra/messages/unsubscribe.rb +12 -0
- data/lib/sif/infra/messages/wakeup.rb +11 -0
- data/lib/sif/infra/messages/zone_status_role.rb +12 -0
- data/lib/sif/infra/objects/agent_acl.rb +19 -0
- data/lib/sif/infra/objects/zone_status.rb +30 -0
- data/lib/sif/models/common/address.rb +21 -0
- data/lib/sif/models/common/alert_message.rb +12 -0
- data/lib/sif/models/common/base_name.rb +12 -0
- data/lib/sif/models/common/calendar_summary.rb +28 -0
- data/lib/sif/models/common/code.rb +12 -0
- data/lib/sif/models/common/contact_info.rb +21 -0
- data/lib/sif/models/common/credits_attempted.rb +12 -0
- data/lib/sif/models/common/demographics.rb +31 -0
- data/lib/sif/models/common/dwelling_arrangement.rb +14 -0
- data/lib/sif/models/common/earned_status.rb +15 -0
- data/lib/sif/models/common/electronic_id.rb +12 -0
- data/lib/sif/models/common/email.rb +13 -0
- data/lib/sif/models/common/english_proficiency.rb +14 -0
- data/lib/sif/models/common/exceptionality_category.rb +13 -0
- data/lib/sif/models/common/grade_level.rb +12 -0
- data/lib/sif/models/common/grid_location.rb +12 -0
- data/lib/sif/models/common/identification_info.rb +12 -0
- data/lib/sif/models/common/language.rb +14 -0
- data/lib/sif/models/common/meal_status.rb +16 -0
- data/lib/sif/models/common/medical_alert_message.rb +12 -0
- data/lib/sif/models/common/meeting_time.rb +12 -0
- data/lib/sif/models/common/name.rb +19 -0
- data/lib/sif/models/common/other_code.rb +12 -0
- data/lib/sif/models/common/other_id.rb +12 -0
- data/lib/sif/models/common/phone_number.rb +15 -0
- data/lib/sif/models/common/principal_info.rb +12 -0
- data/lib/sif/models/common/race.rb +15 -0
- data/lib/sif/models/common/sced_code.rb +15 -0
- data/lib/sif/models/common/schedule_info.rb +14 -0
- data/lib/sif/models/common/schedule_info_override.rb +13 -0
- data/lib/sif/models/common/school_contact.rb +13 -0
- data/lib/sif/models/common/school_course_info_override.rb +18 -0
- data/lib/sif/models/common/street.rb +22 -0
- data/lib/sif/models/common/subject_area.rb +13 -0
- data/lib/sif/models/groups/data_model/term_span.rb +14 -0
- data/lib/sif/models/groups/sis/attendance_code_info.rb +23 -0
- data/lib/sif/models/groups/sis/calendar_date.rb +25 -0
- data/lib/sif/models/groups/sis/discipline_incident.rb +31 -0
- data/lib/sif/models/groups/sis/lea_info.rb +28 -0
- data/lib/sif/models/groups/sis/personal_representer.rb +22 -0
- data/lib/sif/models/groups/sis/school_course_info.rb +30 -0
- data/lib/sif/models/groups/sis/school_info.rb +32 -0
- data/lib/sif/models/groups/sis/section_info.rb +26 -0
- data/lib/sif/models/groups/sis/sis_representer.rb +15 -0
- data/lib/sif/models/groups/sis/staff_personal.rb +20 -0
- data/lib/sif/models/groups/sis/student_personal.rb +37 -0
- data/lib/sif/models/groups/sis/student_section_enrollment.rb +21 -0
- data/lib/sif/models/groups/sis/term_info.rb +29 -0
- data/lib/sif/representations/infra/common/application.rb +16 -0
- data/lib/sif/representations/infra/common/condition.rb +16 -0
- data/lib/sif/representations/infra/common/condition_group.rb +18 -0
- data/lib/sif/representations/infra/common/data.rb +17 -0
- data/lib/sif/representations/infra/common/error.rb +17 -0
- data/lib/sif/representations/infra/common/event.rb +0 -0
- data/lib/sif/representations/infra/common/event_object.rb +15 -0
- data/lib/sif/representations/infra/common/extended_query.rb +18 -0
- data/lib/sif/representations/infra/common/extended_query_results.rb +15 -0
- data/lib/sif/representations/infra/common/header.rb +23 -0
- data/lib/sif/representations/infra/common/message.rb +54 -0
- data/lib/sif/representations/infra/common/object.rb +14 -0
- data/lib/sif/representations/infra/common/object_data.rb +43 -0
- data/lib/sif/representations/infra/common/other_id.rb +15 -0
- data/lib/sif/representations/infra/common/property.rb +15 -0
- data/lib/sif/representations/infra/common/protocol.rb +22 -0
- data/lib/sif/representations/infra/common/provision.rb +38 -0
- data/lib/sif/representations/infra/common/query.rb +24 -0
- data/lib/sif/representations/infra/common/query_object.rb +15 -0
- data/lib/sif/representations/infra/common/secure_channel.rb +15 -0
- data/lib/sif/representations/infra/common/security.rb +18 -0
- data/lib/sif/representations/infra/common/status.rb +18 -0
- data/lib/sif/representations/infra/messages/ack.rb +25 -0
- data/lib/sif/representations/infra/messages/event.rb +19 -0
- data/lib/sif/representations/infra/messages/get_message.rb +12 -0
- data/lib/sif/representations/infra/messages/ping.rb +13 -0
- data/lib/sif/representations/infra/messages/provide.rb +19 -0
- data/lib/sif/representations/infra/messages/provision.rb +37 -0
- data/lib/sif/representations/infra/messages/register.rb +30 -0
- data/lib/sif/representations/infra/messages/request.rb +24 -0
- data/lib/sif/representations/infra/messages/response.rb +29 -0
- data/lib/sif/representations/infra/messages/sleep.rb +14 -0
- data/lib/sif/representations/infra/messages/subscribe.rb +19 -0
- data/lib/sif/representations/infra/messages/system_control.rb +23 -0
- data/lib/sif/representations/infra/messages/system_control_data.rb +31 -0
- data/lib/sif/representations/infra/messages/wakeup.rb +14 -0
- data/lib/sif/representations/models/common/address.rb +24 -0
- data/lib/sif/representations/models/common/alert_message.rb +16 -0
- data/lib/sif/representations/models/common/contact_info.rb +28 -0
- data/lib/sif/representations/models/common/credits_attempted.rb +15 -0
- data/lib/sif/representations/models/common/demographics.rb +43 -0
- data/lib/sif/representations/models/common/dwelling_arrangement.rb +18 -0
- data/lib/sif/representations/models/common/electronic_id.rb +16 -0
- data/lib/sif/representations/models/common/email.rb +16 -0
- data/lib/sif/representations/models/common/english_proficiency.rb +17 -0
- data/lib/sif/representations/models/common/identification_info.rb +16 -0
- data/lib/sif/representations/models/common/language.rb +19 -0
- data/lib/sif/representations/models/common/medical_alert_message.rb +15 -0
- data/lib/sif/representations/models/common/meeting_time.rb +16 -0
- data/lib/sif/representations/models/common/name.rb +22 -0
- data/lib/sif/representations/models/common/other_code.rb +15 -0
- data/lib/sif/representations/models/common/other_id.rb +15 -0
- data/lib/sif/representations/models/common/phone_number.rb +18 -0
- data/lib/sif/representations/models/common/principal_info.rb +15 -0
- data/lib/sif/representations/models/common/race.rb +18 -0
- data/lib/sif/representations/models/common/sced_code.rb +18 -0
- data/lib/sif/representations/models/common/schedule_info.rb +19 -0
- data/lib/sif/representations/models/common/schedule_info_override.rb +18 -0
- data/lib/sif/representations/models/common/school_contact.rb +17 -0
- data/lib/sif/representations/models/common/school_course_info_override.rb +21 -0
- data/lib/sif/representations/models/common/street.rb +26 -0
- data/lib/sif/representations/models/common/subject_area.rb +17 -0
- data/lib/sif/representations/models/groups/data_model/term_span.rb +20 -0
- data/lib/sif/representations/models/groups/sis/personal_representer.rb +38 -0
- data/lib/sif/representations/models/groups/sis/school_course_info.rb +36 -0
- data/lib/sif/representations/models/groups/sis/school_info.rb +47 -0
- data/lib/sif/representations/models/groups/sis/section_info.rb +29 -0
- data/lib/sif/representations/models/groups/sis/sis_representer.rb +17 -0
- data/lib/sif/representations/models/groups/sis/staff_personal.rb +19 -0
- data/lib/sif/representations/models/groups/sis/student_personal.rb +37 -0
- data/lib/sif/representations/models/groups/sis/student_section_enrollment.rb +26 -0
- data/lib/sif/representations/models/groups/sis/term_info.rb +30 -0
- data/lib/sif/sif.rb +249 -0
- data/openagent.gemspec +33 -0
- data/spec/agent_spec.rb +32 -0
- data/spec/client_spec.rb +96 -0
- data/spec/fixtures/agent.yaml +31 -0
- data/spec/fixtures/messages/event.xml +72 -0
- data/spec/fixtures/messages/response.xml +107 -0
- data/spec/fixtures/sif/attendance_code_info.xml +9 -0
- data/spec/fixtures/sif/calendar_date.xml +22 -0
- data/spec/fixtures/sif/calendar_summary.xml +21 -0
- data/spec/fixtures/sif/demographics.xml +33 -0
- data/spec/fixtures/sif/discipline_incident.xml +70 -0
- data/spec/fixtures/sif/lea_info.xml +55 -0
- data/spec/fixtures/sif/section_info.xml +1536 -0
- data/spec/fixtures/sif/sif_header.xml +12 -0
- data/spec/fixtures/sif/sif_message__response.xml +107 -0
- data/spec/fixtures/sif/sif_object_data.xml +5 -0
- data/spec/fixtures/sif/sif_protocol.xml +3 -0
- data/spec/fixtures/sif/sif_protocol__properties.xml +10 -0
- data/spec/fixtures/sif/sif_provide.xml +9 -0
- data/spec/fixtures/sif/sif_provision.xml +33 -0
- data/spec/fixtures/sif/sif_register.xml +20 -0
- data/spec/fixtures/sif/sif_request.xml +21 -0
- data/spec/fixtures/sif/sif_response.xml +19 -0
- data/spec/fixtures/sif/sif_system_control.xml +10 -0
- data/spec/fixtures/sif/stu_pers_resp.xml +2 -0
- data/spec/fixtures/sif/student_personal.xml +42 -0
- data/spec/fixtures/zone.yaml +6 -0
- data/spec/message_builder_spec.rb +81 -0
- data/spec/response_spec.rb +35 -0
- data/spec/sif/representations/xml/header_spec.rb +30 -0
- data/spec/sif/representations/xml/message_spec.rb +20 -0
- data/spec/sif/representations/xml/object_data_spec.rb +19 -0
- data/spec/sif/representations/xml/protocol_spec.rb +34 -0
- data/spec/sif/representations/xml/provide_spec.rb +19 -0
- data/spec/sif/representations/xml/provision_spec.rb +56 -0
- data/spec/sif/representations/xml/register_spec.rb +17 -0
- data/spec/sif/representations/xml/request_spec.rb +17 -0
- data/spec/sif/representations/xml/response_spec.rb +16 -0
- data/spec/sif/representations/xml/spec_helper.rb +7 -0
- data/spec/sif/representations/xml/student_personal_spec.rb +69 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/zone_spec.rb +26 -0
- metadata +455 -0
data/openagent.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'openagent/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "openagent"
|
8
|
+
gem.summary = "OpenAgent is a SIF Agent Development Kit"
|
9
|
+
gem.description = "OpenAgent - SIF ADK (SIF Agent Development Kit)"
|
10
|
+
gem.homepage = "http://github.com/cwhiteley/openagent"
|
11
|
+
gem.authors = ['Christopher Whiteley', 'Duane Johnson', 'Eric Adams']
|
12
|
+
gem.email = ['hello@openzis.org', 'duane@instructure.com', 'eadams@instructure.com']
|
13
|
+
|
14
|
+
gem.files = %w[openagent.gemspec README.md]
|
15
|
+
gem.files += Dir.glob("lib/**/*.rb")
|
16
|
+
gem.files += Dir.glob("spec/**/*")
|
17
|
+
|
18
|
+
gem.test_files = Dir.glob("spec/**/*")
|
19
|
+
gem.require_paths = ["lib"]
|
20
|
+
gem.version = OpenAgent::VERSION
|
21
|
+
gem.required_ruby_version = '>= 1.9.0'
|
22
|
+
|
23
|
+
gem.add_development_dependency "rake"
|
24
|
+
gem.add_development_dependency "webmock"
|
25
|
+
gem.add_development_dependency "bundler", ">= 1.0.0"
|
26
|
+
gem.add_development_dependency "rspec", "~> 2.6"
|
27
|
+
gem.add_development_dependency "debugger"
|
28
|
+
gem.add_development_dependency "pry"
|
29
|
+
|
30
|
+
gem.add_dependency "uuid"
|
31
|
+
gem.add_dependency "representable", "~> 1.7.2"
|
32
|
+
gem.add_dependency "virtus", "~> 1.0.0"
|
33
|
+
end
|
data/spec/agent_spec.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative "spec_helper"
|
2
|
+
require "openagent/agent"
|
3
|
+
require "yaml"
|
4
|
+
|
5
|
+
describe OpenAgent::Agent do
|
6
|
+
context "new object" do
|
7
|
+
let(:agent) { OpenAgent::Agent.new(:name => "SOURCEID") }
|
8
|
+
|
9
|
+
it "sets instance variables from config" do
|
10
|
+
agent.name.should == "SOURCEID"
|
11
|
+
end
|
12
|
+
|
13
|
+
it ":version has a default value" do
|
14
|
+
agent.version.should == "2.0r1"
|
15
|
+
end
|
16
|
+
|
17
|
+
it ":source_id uses :name as default value" do
|
18
|
+
agent.source_id.should == "SOURCEID"
|
19
|
+
agent.source_id.should == agent.name
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context "object from yaml" do
|
24
|
+
let(:agent) { OpenAgent::Agent.new(YAML.load(File.read(fixture("agent.yaml")))) }
|
25
|
+
|
26
|
+
it "sets instance variables from yaml file" do
|
27
|
+
agent.source_id.should == "canvas"
|
28
|
+
agent.instance_variable_get("@source_id").should == "canvas"
|
29
|
+
agent.name.should == "Canvas by Instructure"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/spec/client_spec.rb
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
require_relative "spec_helper"
|
2
|
+
require "openagent/client"
|
3
|
+
|
4
|
+
describe OpenAgent::Client do
|
5
|
+
|
6
|
+
context "agent options" do
|
7
|
+
let(:agent) { OpenAgent::Agent.new(YAML::load(File.read(fixture('agent.yaml')))) }
|
8
|
+
let(:zone) { OpenAgent::Zone.new(YAML::load(File.read(fixture('zone.yaml')))) }
|
9
|
+
end
|
10
|
+
|
11
|
+
subject(:client) { OpenAgent::Client.new( :name => "canvas", :url => "http://localhost:8765" ) }
|
12
|
+
|
13
|
+
it "initializes" do
|
14
|
+
client.name.should == "canvas"
|
15
|
+
client.url.should == "http://localhost:8765"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "initializes the agent" do
|
19
|
+
client.agent.tap do |a|
|
20
|
+
a.name.should == "canvas"
|
21
|
+
a.source_id.should == "canvas"
|
22
|
+
a.msg_version.should == "2.0r1"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it "initializes the zone" do
|
27
|
+
client.zone.tap do |z|
|
28
|
+
z.url.host.should == "localhost"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "given a response message" do
|
33
|
+
let(:message) do
|
34
|
+
SIF::Infra::Common::Message.new(
|
35
|
+
:ack => SIF::Infra::Message::Ack.new(
|
36
|
+
:header => SIF::Infra::Common::Header.new(
|
37
|
+
:msg_id => "D72C57",
|
38
|
+
:timestamp => "2013-10-09T10:42:16-06:00",
|
39
|
+
:source_id => "canvas"
|
40
|
+
),
|
41
|
+
:original_source_id => "canvas",
|
42
|
+
:original_msg_id => "088E68",
|
43
|
+
:status => SIF::Infra::Common::Status.new(
|
44
|
+
:code => 0
|
45
|
+
)
|
46
|
+
)
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "checks for errors" do
|
51
|
+
lambda { client.send(:check_for_errors, message) }.should_not \
|
52
|
+
raise_error
|
53
|
+
end
|
54
|
+
|
55
|
+
it "raises error on status code" do
|
56
|
+
message.ack.status.code = 7
|
57
|
+
lambda { client.send(:check_for_errors, message) }.should \
|
58
|
+
raise_error(OpenAgent::SIFCodeError)
|
59
|
+
end
|
60
|
+
|
61
|
+
it "raises error if SIF_Error present" do
|
62
|
+
message.ack.error = SIF::Infra::Common::Error.new(
|
63
|
+
:category => 0,
|
64
|
+
:code => 1,
|
65
|
+
:desc => "Unknown SIF_Error error"
|
66
|
+
)
|
67
|
+
lambda { client.send(:check_for_errors, message) }.should \
|
68
|
+
raise_error(OpenAgent::SIFError)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# it "acks" do
|
73
|
+
# stub_request(:post, "http://localhost:8765/").
|
74
|
+
# with(:body => "<SIF_Message xmlns=\"http://www.sifinfo.org/infrastructure/2.x\" Version=\"2.0r1\">\n <SIF_Ack>\n <SIF_OriginalSourceId>ORIG_SRC_ID</SIF_OriginalSourceId>\n <SIF_OriginalMsgId>ORIG_MSG_ID</SIF_OriginalMsgId>\n <SIF_Header>\n <SIF_MsgId>MSG_ID</SIF_MsgId>\n <SIF_Timestamp>TIMESTAMP</SIF_Timestamp>\n <SIF_SourceId>canvas</SIF_SourceId>\n </SIF_Header>\n <SIF_Status>\n <SIF_Code>1</SIF_Code>\n </SIF_Status>\n </SIF_Ack>\n</SIF_Message>",
|
75
|
+
# :headers => {'Accept'=>'*/*', 'Content-Type'=>'application/xml', 'User-Agent'=>'Ruby'}).
|
76
|
+
# to_return(:status => 200, :body => "", :headers => {})
|
77
|
+
|
78
|
+
# client.builder.guuid = "MSG_ID"
|
79
|
+
# client.builder.timestamp = "TIMESTAMP"
|
80
|
+
# client.ack("ORIG_SRC_ID", "ORIG_MSG_ID") do |*args|
|
81
|
+
# p args
|
82
|
+
# end
|
83
|
+
# # xml.should == "<SIF_Message Version=\"2.0r1\" xmlns=\"http://www.sifinfo.org/infrastructure/2.x\">\n <SIF_Register>\n <SIF_Header>\n <SIF_MsgId>DD39ED00127F01313D6F14109FD501C1</SIF_MsgId>\n <SIF_Timestamp>2013-10-08T13:43:44</SIF_Timestamp>\n <SIF_SourceId>TEST_SOURCEID</SIF_SourceId>\n </SIF_Header>\n <SIF_Name>TEST_SIF_NAME</SIF_Name>\n <SIF_Version>2.0r1</SIF_Version>\n <SIF_MaxBufferSize>64000</SIF_MaxBufferSize>\n <SIF_Mode>Pull</SIF_Mode>\n </SIF_Register>\n</SIF_Message>"
|
84
|
+
# end
|
85
|
+
|
86
|
+
# it "sends a request" do
|
87
|
+
# sif.guuid = "DD39ED00127F01313D6F14109FD501C1"
|
88
|
+
# sif.timestamp = "2013-10-08T13:43:44"
|
89
|
+
# xml, i = activity.create_xml('register')
|
90
|
+
# stub_request(:post, "http://test.zone.url/zone").
|
91
|
+
# with(:body => "<SIF_Message Version=\"2.0r1\" xmlns=\"http://www.sifinfo.org/infrastructure/2.x\">\n <SIF_Register>\n <SIF_Header>\n <SIF_MsgId>DD39ED00127F01313D6F14109FD501C1</SIF_MsgId>\n <SIF_Timestamp>2013-10-08T13:43:44</SIF_Timestamp>\n <SIF_SourceId>TEST_SOURCEID</SIF_SourceId>\n </SIF_Header>\n <SIF_Name>TEST_SIF_NAME</SIF_Name>\n <SIF_Version>2.0r1</SIF_Version>\n <SIF_MaxBufferSize>64000</SIF_MaxBufferSize>\n <SIF_Mode>Pull</SIF_Mode>\n </SIF_Register>\n</SIF_Message>",
|
92
|
+
# :headers => {'Accept'=>'*/*', 'Content-Type'=>'application/xml', 'User-Agent'=>'Ruby'}).
|
93
|
+
# to_return(:status => 200, :body => "", :headers => {})
|
94
|
+
# response = zone.send_message(xml)
|
95
|
+
# end
|
96
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
---
|
2
|
+
source_id: canvas
|
3
|
+
name: Canvas by Instructure
|
4
|
+
version: 2.0r1
|
5
|
+
max_buffer_size: 64000
|
6
|
+
mode: Pull
|
7
|
+
msg_version: 2.0r1
|
8
|
+
msg_xmlns: http://www.sifinfo.org/infrastructure/2.x
|
9
|
+
provide:
|
10
|
+
subscribe:
|
11
|
+
- LEAInfo
|
12
|
+
- SchoolInfo
|
13
|
+
- TermInfo
|
14
|
+
- SchoolCourseInfo
|
15
|
+
- SectionInfo
|
16
|
+
- StudentPersonal
|
17
|
+
- StaffPersonal
|
18
|
+
- StudentSectionInfo
|
19
|
+
publish_add:
|
20
|
+
publish_change:
|
21
|
+
publish_delete:
|
22
|
+
request:
|
23
|
+
- LEAInfo
|
24
|
+
- SchoolInfo
|
25
|
+
- TermInfo
|
26
|
+
- SchoolCourseInfo
|
27
|
+
- SectionInfo
|
28
|
+
- StudentPersonal
|
29
|
+
- StaffPersonal
|
30
|
+
- StudentSectionInfo
|
31
|
+
respond:
|
@@ -0,0 +1,72 @@
|
|
1
|
+
<SIF_Message xmlns="http://www.sifinfo.org/infrastructure/2.x" Version="2.0r1">
|
2
|
+
<SIF_Ack>
|
3
|
+
<SIF_Header>
|
4
|
+
<SIF_MsgId>44353D742D7F42F6A5AEEDCF4F661710</SIF_MsgId>
|
5
|
+
<SIF_Timestamp>2013-10-08T13:19:15-06:00</SIF_Timestamp>
|
6
|
+
<SIF_SourceId>canvas</SIF_SourceId>
|
7
|
+
</SIF_Header>
|
8
|
+
<SIF_OriginalSourceId>canvas</SIF_OriginalSourceId>
|
9
|
+
<SIF_OriginalMsgId>CBAEC920127C01319D7D48E0EB1826A1</SIF_OriginalMsgId>
|
10
|
+
<SIF_Status>
|
11
|
+
<SIF_Code>0</SIF_Code>
|
12
|
+
<SIF_Data>
|
13
|
+
<SIF_Message Version="2.0r1" xmlns="http://www.sifinfo.org/infrastructure/2.x">
|
14
|
+
<SIF_Event>
|
15
|
+
<SIF_Header>
|
16
|
+
<SIF_MsgId>1BD67F9593DC4867AD8A341F0EC7886C</SIF_MsgId>
|
17
|
+
<SIF_Timestamp>2013-10-08T11:36:06-06:00</SIF_Timestamp>
|
18
|
+
<SIF_SourceId>test</SIF_SourceId>
|
19
|
+
<SIF_DestinationId>canvas</SIF_DestinationId>
|
20
|
+
</SIF_Header>
|
21
|
+
<SIF_ObjectData>
|
22
|
+
<SIF_EventObject Action="Add" ObjectName="StudentPersonal">
|
23
|
+
<StudentPersonal RefId="D3E34B359D75101A8C3D00AA001A1652">
|
24
|
+
<AlertMessages>
|
25
|
+
<AlertMessage Type="Legal">This is the Legal Alert for Joe Student</AlertMessage>
|
26
|
+
</AlertMessages>
|
27
|
+
<LocalId>P00001</LocalId>
|
28
|
+
<StateProvinceId>WB0025</StateProvinceId>
|
29
|
+
<ElectronicIdList>
|
30
|
+
<ElectronicId Type="Barcode">206654</ElectronicId>
|
31
|
+
</ElectronicIdList>
|
32
|
+
<Name Type="04">
|
33
|
+
<LastName>Student</LastName>
|
34
|
+
<FirstName>Joe</FirstName>
|
35
|
+
<MiddleName/>
|
36
|
+
<PreferredName>Joe</PreferredName>
|
37
|
+
</Name>
|
38
|
+
<Demographics>
|
39
|
+
<Gender>M</Gender>
|
40
|
+
</Demographics>
|
41
|
+
<AddressList>
|
42
|
+
<Address Type="0123">
|
43
|
+
<Street>
|
44
|
+
<Line1>6799 33rd Ave.</Line1>
|
45
|
+
<StreetNumber>6799</StreetNumber>
|
46
|
+
<StreetName>33rd</StreetName>
|
47
|
+
<StreetType>Ave.</StreetType>
|
48
|
+
</Street>
|
49
|
+
<City>Chicago</City>
|
50
|
+
<StateProvince>IL</StateProvince>
|
51
|
+
<Country>US</Country>
|
52
|
+
<PostalCode>60660</PostalCode>
|
53
|
+
</Address>
|
54
|
+
</AddressList>
|
55
|
+
<PhoneNumberList>
|
56
|
+
<PhoneNumber Type="0096">
|
57
|
+
<Number>(312) 555-1234</Number>
|
58
|
+
</PhoneNumber>
|
59
|
+
</PhoneNumberList>
|
60
|
+
<EmailList>
|
61
|
+
<Email Type="Primary">Joe.Student@anyschool.com</Email>
|
62
|
+
</EmailList>
|
63
|
+
<OnTimeGraduationYear>2007</OnTimeGraduationYear>
|
64
|
+
</StudentPersonal>
|
65
|
+
</SIF_EventObject>
|
66
|
+
</SIF_ObjectData>
|
67
|
+
</SIF_Event>
|
68
|
+
</SIF_Message>
|
69
|
+
</SIF_Data>
|
70
|
+
</SIF_Status>
|
71
|
+
</SIF_Ack>
|
72
|
+
</SIF_Message>
|
@@ -0,0 +1,107 @@
|
|
1
|
+
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2
|
+
|
3
|
+
<SIF_Message xmlns="http://www.sifinfo.org/infrastructure/2.x" Version="2.0r1">
|
4
|
+
<SIF_Ack>
|
5
|
+
<SIF_Header>
|
6
|
+
<SIF_MsgId>D72C57D4EE0D4E0AB68BD2393B12E51D</SIF_MsgId>
|
7
|
+
<SIF_Timestamp>2013-10-09T10:42:16-06:00</SIF_Timestamp>
|
8
|
+
<SIF_SourceId>canvas</SIF_SourceId>
|
9
|
+
</SIF_Header>
|
10
|
+
<SIF_OriginalSourceId>canvas</SIF_OriginalSourceId>
|
11
|
+
<SIF_OriginalMsgId>088E6810133001313D9314109FD501C1</SIF_OriginalMsgId>
|
12
|
+
<SIF_Status>
|
13
|
+
<SIF_Code>0</SIF_Code>
|
14
|
+
<SIF_Data>
|
15
|
+
<SIF_Message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="2.0r1">
|
16
|
+
<SIF_Response>
|
17
|
+
<SIF_Header>
|
18
|
+
<SIF_MsgId>026340A188BA4EAF97C0D42E37F1302C</SIF_MsgId>
|
19
|
+
<SIF_Timestamp>2013-10-09T10:19:20-06:00</SIF_Timestamp>
|
20
|
+
<SIF_Security>
|
21
|
+
<SIF_SecureChannel>
|
22
|
+
<SIF_AuthenticationLevel>0</SIF_AuthenticationLevel>
|
23
|
+
<SIF_EncryptionLevel>0</SIF_EncryptionLevel>
|
24
|
+
</SIF_SecureChannel>
|
25
|
+
</SIF_Security>
|
26
|
+
<SIF_SourceId>PowerSchool</SIF_SourceId>
|
27
|
+
<SIF_DestinationId>canvas</SIF_DestinationId>
|
28
|
+
</SIF_Header>
|
29
|
+
<SIF_RequestMsgId>6B05EF70132C01319D9348E0EB1826A1</SIF_RequestMsgId>
|
30
|
+
<SIF_PacketNumber>209</SIF_PacketNumber>
|
31
|
+
<SIF_MorePackets>Yes</SIF_MorePackets>
|
32
|
+
<SIF_ObjectData>
|
33
|
+
<StudentPersonal RefId="140A051A0D2B360A1E1F0E251FBA175A">
|
34
|
+
<LocalId>24939</LocalId>
|
35
|
+
<StateProvinceId>1877331</StateProvinceId>
|
36
|
+
<OtherIdList>
|
37
|
+
<OtherId Type="9999">SCHOOL:304</OtherId>
|
38
|
+
</OtherIdList>
|
39
|
+
<Name Type="04">
|
40
|
+
<LastName>Ellis</LastName>
|
41
|
+
<FirstName>Karl</FirstName>
|
42
|
+
<MiddleName>E</MiddleName>
|
43
|
+
<FullName>Ellis, Karl E</FullName>
|
44
|
+
</Name>
|
45
|
+
<Demographics>
|
46
|
+
<RaceList>
|
47
|
+
<Race>
|
48
|
+
<Code>1002</Code>
|
49
|
+
<OtherCodeList>
|
50
|
+
<OtherCode Codeset="Local">C</OtherCode>
|
51
|
+
</OtherCodeList>
|
52
|
+
</Race>
|
53
|
+
</RaceList>
|
54
|
+
<HispanicLatino>No</HispanicLatino>
|
55
|
+
<Gender>M</Gender>
|
56
|
+
<BirthDate>1997-08-02</BirthDate>
|
57
|
+
</Demographics>
|
58
|
+
<AddressList>
|
59
|
+
<Address Type="0765">
|
60
|
+
<Street>
|
61
|
+
<Line1>123 Love Ln</Line1>
|
62
|
+
</Street>
|
63
|
+
<City>Ruraltown</City>
|
64
|
+
<StateProvince>UT</StateProvince>
|
65
|
+
<Country>US</Country>
|
66
|
+
<PostalCode>84612</PostalCode>
|
67
|
+
</Address>
|
68
|
+
<Address Type="0123">
|
69
|
+
<Street>
|
70
|
+
<Line1>123 Love Ln</Line1>
|
71
|
+
</Street>
|
72
|
+
<City>Ruraltown</City>
|
73
|
+
<StateProvince>UT</StateProvince>
|
74
|
+
<Country>US</Country>
|
75
|
+
<PostalCode>84612</PostalCode>
|
76
|
+
</Address>
|
77
|
+
</AddressList>
|
78
|
+
<PhoneNumberList>
|
79
|
+
<PhoneNumber Type="0096">
|
80
|
+
<Number>801-123-1234</Number>
|
81
|
+
</PhoneNumber>
|
82
|
+
<PhoneNumber Type="0350">
|
83
|
+
<Number>858-123-5678</Number>
|
84
|
+
</PhoneNumber>
|
85
|
+
</PhoneNumberList>
|
86
|
+
<EmailList>
|
87
|
+
<Email Type="Primary">karl@gmail.com,karlsdad@gmail.com</Email>
|
88
|
+
</EmailList>
|
89
|
+
<ProjectedGraduationYear>2017</ProjectedGraduationYear>
|
90
|
+
<OnTimeGraduationYear>2017</OnTimeGraduationYear>
|
91
|
+
<MostRecent>
|
92
|
+
<SchoolLocalId>304</SchoolLocalId>
|
93
|
+
<GradeLevel>
|
94
|
+
<Code>09</Code>
|
95
|
+
</GradeLevel>
|
96
|
+
</MostRecent>
|
97
|
+
<SIF_ExtendedElements>
|
98
|
+
<SIF_ExtendedElement Name="StudentEthnicity">1002</SIF_ExtendedElement>
|
99
|
+
</SIF_ExtendedElements>
|
100
|
+
</StudentPersonal>
|
101
|
+
</SIF_ObjectData>
|
102
|
+
</SIF_Response>
|
103
|
+
</SIF_Message>
|
104
|
+
</SIF_Data>
|
105
|
+
</SIF_Status>
|
106
|
+
</SIF_Ack>
|
107
|
+
</SIF_Message>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<AttendanceCodeInfo RefId="64A309DA063A2E35B359D75101A8C3D0" SchoolInfoRefId="CE0674A8BB8247669DE348F113D2316A">
|
2
|
+
<AttendanceCode>AE</AttendanceCode>
|
3
|
+
<AttendanceType>Absent</AttendanceType>
|
4
|
+
<AttendanceStatus>Excused</AttendanceStatus>
|
5
|
+
<Description>Child is absent with appropriate, legal excuse.</Description>
|
6
|
+
<AbsenceValue>1.0</AbsenceValue>
|
7
|
+
<UsedForDailyAttendance>Yes</UsedForDailyAttendance>
|
8
|
+
<UsedForPeriodAttendance>Yes</UsedForPeriodAttendance>
|
9
|
+
</AttendanceCodeInfo>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<CalendarDate Date="2007-08-31" CalendarSummaryRefId="B5739375800AC4CC63850BB2754114AA" SchoolInfoRefId="B7A34E561C97345C0A4E11BB112B2753" SchoolYear="2007">
|
2
|
+
<CalendarDateType>
|
3
|
+
<Code>0845</Code>
|
4
|
+
<OtherCodeList>
|
5
|
+
<OtherCode Codeset="StateProvince">20</OtherCode>
|
6
|
+
<OtherCode Codeset="Local">10</OtherCode>
|
7
|
+
</OtherCodeList>
|
8
|
+
</CalendarDateType>
|
9
|
+
<CalendarDateNumber>1</CalendarDateNumber>
|
10
|
+
<StudentAttendance>
|
11
|
+
<CountsTowardAttendance>No</CountsTowardAttendance>
|
12
|
+
<AttendanceValue>0.0</AttendanceValue>
|
13
|
+
</StudentAttendance>
|
14
|
+
<TeacherAttendance>
|
15
|
+
<CountsTowardAttendance>Yes</CountsTowardAttendance>
|
16
|
+
<AttendanceValue>1.0</AttendanceValue>
|
17
|
+
</TeacherAttendance>
|
18
|
+
<AdministratorAttendance>
|
19
|
+
<CountsTowardAttendance>Yes</CountsTowardAttendance>
|
20
|
+
<AttendanceValue>1.0</AttendanceValue>
|
21
|
+
</AdministratorAttendance>
|
22
|
+
</CalendarDate>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<CalendarSummary RefId="B5739375800AC4CC63850BB2754114AA" SchoolInfoRefId="B7A34E561C97345C0A4E11BB112B2753" SchoolYear="2005">
|
2
|
+
<LocalId>123321A</LocalId>
|
3
|
+
<Description>Elementary School Calendar</Description>
|
4
|
+
<DaysInSession>180</DaysInSession>
|
5
|
+
<FirstInstructionDate>2006-09-05</FirstInstructionDate>
|
6
|
+
<LastInstructionDate>2007-06-10</LastInstructionDate>
|
7
|
+
<GraduationDate>2007-06-11</GraduationDate>
|
8
|
+
<InstructionalMinutes>64800</InstructionalMinutes>
|
9
|
+
<MinutesPerDay>360</MinutesPerDay>
|
10
|
+
<GradeLevels>
|
11
|
+
<GradeLevel>
|
12
|
+
<Code>03</Code>
|
13
|
+
</GradeLevel>
|
14
|
+
<GradeLevel>
|
15
|
+
<Code>04</Code>
|
16
|
+
</GradeLevel>
|
17
|
+
<GradeLevel>
|
18
|
+
<Code>05</Code>
|
19
|
+
</GradeLevel>
|
20
|
+
</GradeLevels>
|
21
|
+
</CalendarSummary>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<Demographics>
|
2
|
+
<RaceList>
|
3
|
+
<Race>
|
4
|
+
<Code>1002</Code>
|
5
|
+
</Race>
|
6
|
+
</RaceList>
|
7
|
+
<Gender>M</Gender>
|
8
|
+
<BirthDate>1990-09-26</BirthDate>
|
9
|
+
<BirthDateVerification>1004</BirthDateVerification>
|
10
|
+
<PlaceOfBirth>Miami</PlaceOfBirth>
|
11
|
+
<CountyOfBirth>Dade</CountyOfBirth>
|
12
|
+
<StateOfBirth>FL</StateOfBirth>
|
13
|
+
<CountryOfBirth>US</CountryOfBirth>
|
14
|
+
<CountriesOfCitizenship>
|
15
|
+
<CountryOfCitizenship>US</CountryOfCitizenship>
|
16
|
+
</CountriesOfCitizenship>
|
17
|
+
<CountriesOfResidency>
|
18
|
+
<CountryOfResidency>US</CountryOfResidency>
|
19
|
+
</CountriesOfResidency>
|
20
|
+
<CitizenshipStatus>1017</CitizenshipStatus>
|
21
|
+
<EnglishProficiency>
|
22
|
+
<Code>1633</Code>
|
23
|
+
</EnglishProficiency>
|
24
|
+
<LanguageList>
|
25
|
+
<Language>
|
26
|
+
<Code>eng</Code>
|
27
|
+
</Language>
|
28
|
+
</LanguageList>
|
29
|
+
<DwellingArrangement>
|
30
|
+
<Code>1674</Code>
|
31
|
+
</DwellingArrangement>
|
32
|
+
<MaritalStatus>1042</MaritalStatus>
|
33
|
+
</Demographics>
|