Diagnosing account, enrolment and snapshot problems using the APIsDr Malcolm MurrayDurham UniversityPhoto by Terry Bain: http://www.flickr.com/photos/axis/2897335784/
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.
1Modelling UsersLooking at the APIs and peeking under the covers into the database
bb-platform.jarModels common objects seen in the UIblackboard.data.user.Userblackboard.data.role.PortalRoleblackboard.data.course.Courseblackboard.data.course.CourseMembershipblackboard.data.course.CourseMembership$Roleetcetera
bb-platform.jarblackboard.data.user.User
bb-platform.jarblackboard.data.user.User
bb-platform.jarblackboard.data.user.UsergetBatchUid() String
getDataSourceId() String
getIsAvailable()boolean
getUserName() String
getId() Idbb-platform.jarblackboard.data.user.UsergetBatchUid() String
getDataSourceId() String
getIsAvailable() boolean
getUserName() String
getId() IdTwo unique fields! UserName & BatchUid
bb-platform.jarblackboard.data.user.UsergetBatchUid() String
getDataSourceId() String
getIsAvailable() boolean
getUserName() String
getId() Id2SnapshotNothing more than a quick overviewRTFM for more information 
SnapshotMaking sense of complicated dataUsersPortal RolesCoursesCourse RolesQuota
SnapshotReality: multiple sources, frequently changingCourses: TimetablingRoles: LDAPRoles: Student Record SystemUsers: Student Record SystemCourses: Student Record SystemUsers: HR SystemRoles: HR System
Managing SnapshotPreparation, Preparation, PreparationQuota feedCourse feedUser feedEnrol feedRole feed
SnapshotSimplified scenarios – snapshotting UsersUsers are only ever blocked, not removedSNAPSHOT 2SNAPSHOT 1
3Data Source KeysMean nothing to you?Stay awake through this bit then
Data Source KeysOwnership: Makes Snapshot workblackboard.data.user.UsergetBatchUid() String
getDataSourceId() String
getIsAvailable() boolean
getUserName() String
getId() IdUsers created using the UI are given a Data Source Key of SYSTEMSnapshot runs with a different DSK and controls the ROW_STATUS field of all Users with this DSK
Data Source Keysblackboard.data.datasource.DataSourcegetModifiedDate() Calendar
getId() Id
RowStatus not exposed
getBatchUid() String
getDescription() StringRow StatusControlling accessROW_STATUS = 0  normal accessROW_STATUS = 2  no access (blocked)So where can you see this?
4And then there were Two...Working with multiple JAR filesuntil these are finally merged in a future API release
Enter bb-cms-admin.jarMany of the classes seen in bb-platform.jarblackboard.data.user.Userblackboard.data.role.PortalRoleblackboard.data.course.Courseblackboard.data.course.CourseMembershipblackboard.data.course.CourseMembership$Roleare extended by classes in bb-cms-admin.jarblackboard.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.StaffAssignmentbb-cms-admin.jarblackboard.admin.data.user.PersongetRowStatus() would be here
Loaders & Persistersblackboard.persist.user.UserDbLoader – many optionsBut...UserDbLoader will only load User objects where the underlying USERS database table entry has  ROW_STATUS = 0
Loaders & Persistersblackboard.admin.persist.user.PersonLoaderPersonLoader loads any entry
Loading Persons by TemplateSELECT * FROM BB_BB60.USERS WHERE AVAILABLE_IND = ‘N' AND LASTNAME = 'Smith' AND ROW_STATUS = 2;
5Applying this knowledgeAccount Problems – “I can’t log in...”
ACCESS?Diagnosis requirements – User AccountUserAvailabilityUser.getIsAvailable() or Person.getIsAvailable()Row StatusPerson.getRowStatus()Data Source KeyTwo parts:Person.getDataSourceBatchUid()  - may be enoughUser only exposes getDataSourceId()blackboard.admin.persist.datasource.DataSourceLoader. loadByBatchUid()  no loadById() methodblackboard.admin.data.datasource.DataSource.getDescription()OWNER?
Model of the ProcessNot Rocket Science...Entry Point:ModuleUsername Known?NOSearch ToolYESIdentify UserDisplay InformationFix Problem
Implementation

Diagnosing account, enrolment and snapshot problems using the APIs