diagnosing account, enrolment and snapshot problems using the apis
DESCRIPTION
Presentation given at the 2010 Blackboard Developer's conference in Orlando. Looks at how you can use the Blackboard APIs to diagnose and fix problems with user accounts and course enrolmentsTRANSCRIPT
![Page 1: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/1.jpg)
Diagnosing account, enrolment and snapshot problems using the APIs
Dr Malcolm MurrayDurham University
Photo by Terry Bain: http://www.flickr.com/photos/axis/2897335784/
![Page 2: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/2.jpg)
Conference Blurb…
I've designed custom user and course tools to help diagnose and repair problems with user feeds and snapshotted enrolments. I'll demonstrate how you can use APIs to access fields not exposed in the UI. I'll also discuss times when directly querying the database is still the best thing to do (i.e. when there aren't comprehensive enough classes to use). I'll conclude with a discussion of managing access by portal role.
![Page 3: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/3.jpg)
Modelling UsersLooking at the APIs
and peeking under the covers into the database1
![Page 4: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/4.jpg)
bb-platform.jar
Models common objects seen in the UI
• blackboard.data.user.User
• blackboard.data.role.PortalRole
• blackboard.data.course.Course
• blackboard.data.course.CourseMembership
• blackboard.data.course.CourseMembership$Role
• etcetera
![Page 5: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/5.jpg)
bb-platform.jar
blackboard.data.user.User
![Page 6: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/6.jpg)
bb-platform.jar
blackboard.data.user.User
![Page 7: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/7.jpg)
bb-platform.jar
blackboard.data.user.User
• getBatchUid() String
• getDataSourceId() String
• getIsAvailable() boolean
• getUserName() String
• getId() Id
![Page 8: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/8.jpg)
bb-platform.jar
blackboard.data.user.User
• getBatchUid() String
• getDataSourceId() String
• getIsAvailable() boolean
• getUserName() String
• getId() Id
Two unique fields!
UserName & BatchUid
![Page 9: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/9.jpg)
bb-platform.jar
blackboard.data.user.User
• getBatchUid() String
• getDataSourceId() String
• getIsAvailable() boolean
• getUserName() String
• getId() Id
![Page 10: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/10.jpg)
SnapshotNothing more than a quick overview
RTFM for more information 2
![Page 11: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/11.jpg)
Snapshot
Making sense of complicated data
Course Roles
Courses
UsersPortal Roles
Quota
![Page 12: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/12.jpg)
Snapshot
Reality: multiple sources, frequently changing
Users: Student Record System
Users: HR System
Roles: HR System
Roles: Student Record SystemRole
s: LD
AP
Courses: Student Record System
Courses: Timetabling
![Page 13: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/13.jpg)
Managing Snapshot
Preparation, Preparation, Preparation
Enrol feed
Course feedUser feed
Role feed
Quota feed
![Page 14: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/14.jpg)
Day 1 Day 2 Day 3
New user
Continuing User
Change to User
Removing User
Snapshot
Simplified scenarios – snapshotting Users
SNAP
SHO
T 1
SNAP
SHO
T 2
Users are only ever
blocked, not removed
![Page 15: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/15.jpg)
Data Source KeysMean nothing to you?
Stay awake through this bit then3
![Page 16: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/16.jpg)
Data Source Keys
Ownership: Makes Snapshot work
User Details
Data Source Key
Portal Role
Data Source Key
Course Membership
Data Source Key
Course
Data Source Key
• getBatchUid() String
• getDataSourceId() String
• getIsAvailable() boolean
• getUserName() String
• getId() Id
blackboard.data.user.User
Snapshot runs with a different DSK and controls the ROW_STATUS field of all Users with this DSK
Users created using the UI are given a Data Source Key of SYSTEM
Content System Quota
Data Source Key
![Page 17: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/17.jpg)
Data Source Keys
blackboard.data.datasource.DataSource• getModifiedDate() Calendar
• getId() Id
• RowStatus not exposed
• getBatchUid() String
• getDescription() String
![Page 18: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/18.jpg)
Row Status
Controlling access
ROW_STATUS = 0 normal access
ROW_STATUS = 2 no access (blocked)
So where can you see this?
![Page 19: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/19.jpg)
And then there were Two...Working with multiple JAR files
until these are finally merged in a future API release4
![Page 20: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/20.jpg)
Enter bb-cms-admin.jar
Many of the classes seen in bb-platform.jar
• blackboard.data.user.User
• blackboard.data.role.PortalRole
• blackboard.data.course.Course
• blackboard.data.course.CourseMembership
• blackboard.data.course.CourseMembership$Role
are extended by classes in bb-cms-admin.jar
• blackboard.admin.data.user.Person
• blackboard.admin.data.role.PortalRoleMembership
• blackboard.admin.data.course.CourseSite
• blackboard.admin.data.course.Membership
• blackboard.admin.data.course.Enrollment
• blackboard.admin.data.course.StaffAssignment
![Page 21: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/21.jpg)
bb-cms-admin.jar
blackboard.admin.data.user.Person
getRowStatus() would be here
![Page 22: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/22.jpg)
Loaders & Persisters
blackboard.persist.user.UserDbLoader – many options
But...UserDbLoader will only
load User objects where the underlying USERS database table
entry has ROW_STATUS = 0
![Page 23: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/23.jpg)
Loaders & Persisters
blackboard.admin.persist.user.PersonLoader
PersonLoader loads any
entry
![Page 24: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/24.jpg)
Loading Persons by Template
SELECT * FROM BB_BB60.USERS WHERE AVAILABLE_IND = ‘N' AND LASTNAME = 'Smith' AND ROW_STATUS = 2;
![Page 25: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/25.jpg)
Applying this knowledge
Account Problems – “I can’t log in...”5
![Page 26: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/26.jpg)
ACCESS?
Diagnosis requirements – User Account
User
• AvailabilityUser.getIsAvailable() or Person.getIsAvailable()
• Row StatusPerson.getRowStatus()
• Data Source KeyTwo parts:1. Person. getDataSourceBatchUid() - may be enough
User only exposes getDataSourceId()2. blackboard.admin.persist.datasource.DataSourceLoader.
loadByBatchUid() no loadById() method3. blackboard.admin.data.datasource.DataSource.getDescription()
OWNER?
![Page 27: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/27.jpg)
Model of the Process
Not Rocket Science... Entry Point:Module
Identify User
Search Tool
Display InformationFix Problem
Username Known? NOYES
![Page 28: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/28.jpg)
Implementation
![Page 29: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/29.jpg)
Display information
![Page 30: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/30.jpg)
Fix Problem
![Page 31: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/31.jpg)
Limits of the APIs
blackboard.persist.user.UserSearchUserSearch can also be a bit picky about
who it returns results too – you may need a SYSTEM_ROLE to see
any!
![Page 32: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/32.jpg)
Wrote my Own!
![Page 33: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/33.jpg)
Populate an ArrayList with Person objects
![Page 34: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/34.jpg)
Very Important
Ensure you always hand back the Connection
![Page 35: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/35.jpg)
Applying this knowledgeEnrolment Problems – “My Current Courses List is wrong...”6
![Page 36: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/36.jpg)
Diagnosis requirements - Enrolment
User
ACCESS?
OWNER?
ACCESS?
OWNER?
ACCESS?
OWNER?
Course
Course Membership Portal Role
ACCESS?
OWNER?
![Page 37: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/37.jpg)
User Account data
• PersonLoader
• DataSourceLoader
Course Data
• CourseSiteLoader
Enrolment Data
• EnrollmentLoader
• StaffAssignmentLoader
• DataSourceLoader
How many database
round-trips would this cost?
Loader-tastic!
Portal Role data
• PortalRoleMembershipLoader
• DataSourceLoader
![Page 38: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/38.jpg)
Displaying Information
![Page 39: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/39.jpg)
Summary of User’s Account Status
![Page 40: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/40.jpg)
Summary of Enrolment
![Page 41: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/41.jpg)
Definitely a candidate for DIY
![Page 42: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/42.jpg)
Definitely a candidate for DIY
![Page 43: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/43.jpg)
All captured in a single custom class
![Page 44: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/44.jpg)
Straying off topic
What you can do with this knowledge7
![Page 45: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/45.jpg)
Manage the Snapshot Rules in Bb
![Page 46: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/46.jpg)
Rules, Roles and Tabs
We are about to completely rewrite the way we grant access to portal tabs (tab_groups)
This should make diagnosing “Who can see what problems” much easier!
![Page 47: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/47.jpg)
Conclusion
Almost there!8
![Page 48: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/48.jpg)
Snapshot
• Secret to success = pre-process your data
• Data Source Keys control what can be changed
• Snapshot alters ROW_STATUS values
• Available and Blocked (RowStatus) are not the same
APIs
• ROW_STATUS values are not accessible using classes in bb-platform.jar
• Classes in bb-cms-admin.jar expose this fields
Applications
• APIs well suited to simple tasks e.g. User Account Issues
• Normalisation of the database and thus the APIs means that some more complicated tasks, e.g. Enrolment Issues, may currently be more efficient using careful SQL queries
![Page 49: Diagnosing account, enrolment and snapshot problems using the APIs](https://reader034.vdocuments.site/reader034/viewer/2022051610/549037c0b4795985378b45fd/html5/thumbnails/49.jpg)
Please provide feedback for this session by emailing [email protected].
The catchy title of this session is:
Diagnosing account, enrolment and snapshot problems using the APIs
You contact the author at