Date post: | 12-Jan-2016 |
Category: |
Documents |
Upload: | barrie-fleming |
View: | 213 times |
Download: | 1 times |
Schedule of Classes Web ServiceTechnology Days 2015June 4, 2015Spirit/Trail
Greg GómezExtended Learning
XML Schedule of Classes
• http://xmlsched.unm.edu
XML Schedule of Classes
• FYI:–We’ll be removing R (Restricted) classes
soon.– It runs at 10:**PM; this is a problem at
the edge of semesters (Mondays)
xml2sql
• Runs every morning.• Extracts all data from the XML
Schedule of Classes• Inserts into MySQL
The Service
• Beta• It’s still being worked on.• It may not always be available.• xml2sql fails on occasion.
The Service
• http://elwebapps.unm.edu• It’s not RESTful– REST: One URN, One Result
• Instead, it uses AJAX-style queries…
…like this…
• http://elwebapps.unm.edu/schedule/index/basicsectioninfo/crn/10001/s/201560/format/json
• Or• http://elwebapps.unm.edu/schedule/
index/basicsectioninfo?crn=10001&s=201560&format=json
…because
• Normal HTTP• Intuitive• Allows for multiple results
A little clearer
• http://elwebapps.unm.edu/schedule/index/basicsectioninfo
• /crn/10001/s/201560/format/json• ?crn=10001&s=201560&format=json
What does it all mean?
• http://elwebapps.unm.edu/schedule/index/basicsectioninfo/crn/10001/s/201560/format/json
• http://elwebapps.unm.edu/schedule/index/basicsectioninfo?crn=10001&s=201560&format=json
• “action”
What does it all mean?
• http://elwebapps.unm.edu/schedule/index/basicsectioninfo/crn/10001/s/201560/format/json
• http://elwebapps.unm.edu/schedule/index/basicsectioninfo?crn=10001&s=201560&format=json
• CRN
What does it all mean?
• http://elwebapps.unm.edu/schedule/index/basicsectioninfo/crn/10001/s/201560/format/json
• http://elwebapps.unm.edu/schedule/index/basicsectioninfo?crn=10001&s=201560&format=json
• CRN
An Important Note
• Semester code + crn = unique identifier
What does it all mean?
• http://elwebapps.unm.edu/schedule/index/basicsectioninfo/crn/10001/s/201560/format/json
• http://elwebapps.unm.edu/schedule/index/basicsectioninfo?crn=10001&s=201560&format=json
• Format (of response)
An Important Note
• Although format isn’t required, it’s a very good idea to include it (for now).
Current Actions
• basicsectioninfo• instructorsections• allsemesters• meetingsnow
Current Actions
• basicsectioninfo– crn– s– format
Current Actions
• instructorsections– n (NetID)– s– format
Current Actions
• meetingsnow– bid (Building Code)– rn (Room Number)– format
Current Actions
• allsemesters– format
CORS
• Cross-origin resource sharing• The web schedule should be ok.
A ‘Bad’ Response
• Badly formed requests…–Missing data (especially s and crn)– Bad data (crn=1000a)– Etc.
• …will result in ah HTTP 400 Bad Request error
A ‘Good’ Response
• HTTP 200 OK• JSON - Now• XML - ADN• HTML - ADN
Let’s take a look…
Next Steps
• More actions.– Suggestions from the community.
• Kill ‘index’?• Make JSON the default (if not
specified by format)• Sorts (o=crn)