Diagnosing account, enrolment and snapshot problems using the APIs

1,715 views
1,621 views

Published on

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 enrolments

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,715
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
23
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Diagnosing account, enrolment and snapshot problems using the APIs

  1. 1. Diagnosing account, enrolment and snapshot problems using the APIs<br />Dr Malcolm MurrayDurham University<br />Photo by Terry Bain: http://www.flickr.com/photos/axis/2897335784/<br />
  2. 2. Conference Blurb…<br />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.<br />
  3. 3. 1<br />Modelling Users<br />Looking at the APIs and peeking under the covers into the database<br />
  4. 4. bb-platform.jar<br />Models common objects seen in the UI<br />blackboard.data.user.User<br />blackboard.data.role.PortalRole<br />blackboard.data.course.Course<br />blackboard.data.course.CourseMembership<br />blackboard.data.course.CourseMembership$Role<br />etcetera<br />
  5. 5. bb-platform.jar<br />blackboard.data.user.User<br />
  6. 6. bb-platform.jar<br />blackboard.data.user.User<br />
  7. 7. bb-platform.jar<br />blackboard.data.user.User<br /><ul><li>getBatchUid() String
  8. 8. getDataSourceId() String
  9. 9. getIsAvailable()boolean
  10. 10. getUserName() String
  11. 11. getId() Id</li></li></ul><li>bb-platform.jar<br />blackboard.data.user.User<br /><ul><li>getBatchUid() String
  12. 12. getDataSourceId() String
  13. 13. getIsAvailable() boolean
  14. 14. getUserName() String
  15. 15. getId() Id</li></ul>Two unique fields! UserName & BatchUid<br />
  16. 16. bb-platform.jar<br />blackboard.data.user.User<br /><ul><li>getBatchUid() String
  17. 17. getDataSourceId() String
  18. 18. getIsAvailable() boolean
  19. 19. getUserName() String
  20. 20. getId() Id</li></li></ul><li>2<br />Snapshot<br />Nothing more than a quick overviewRTFM for more information <br />
  21. 21. Snapshot<br />Making sense of complicated data<br />Users<br />Portal Roles<br />Courses<br />Course Roles<br />Quota<br />
  22. 22. Snapshot<br />Reality: multiple sources, frequently changing<br />Courses: Timetabling<br />Roles: LDAP<br />Roles: Student Record System<br />Users: Student Record System<br />Courses: Student Record System<br />Users: HR System<br />Roles: HR System<br />
  23. 23. Managing Snapshot<br />Preparation, Preparation, Preparation<br />Quota feed<br />Course feed<br />User feed<br />Enrol feed<br />Role feed<br />
  24. 24. Snapshot<br />Simplified scenarios – snapshotting Users<br />Users are only ever blocked, not removed<br />SNAPSHOT 2<br />SNAPSHOT 1<br />
  25. 25. 3<br />Data Source Keys<br />Mean nothing to you?Stay awake through this bit then<br />
  26. 26. Data Source Keys<br />Ownership: Makes Snapshot work<br />blackboard.data.user.User<br /><ul><li>getBatchUid() String
  27. 27. getDataSourceId() String
  28. 28. getIsAvailable() boolean
  29. 29. getUserName() String
  30. 30. getId() Id</li></ul>Users created using the UI are given a Data Source Key of SYSTEM<br />Snapshot runs with a different DSK and controls the ROW_STATUS field of all Users with this DSK<br />
  31. 31. Data Source Keys<br />blackboard.data.datasource.DataSource<br /><ul><li>getModifiedDate() Calendar
  32. 32. getId() Id
  33. 33. RowStatus not exposed
  34. 34. getBatchUid() String
  35. 35. getDescription() String</li></li></ul><li>Row Status<br />Controlling access<br />ROW_STATUS = 0 normal access<br />ROW_STATUS = 2 no access (blocked)<br />So where can you see this?<br />
  36. 36. 4<br />And then there were Two...<br />Working with multiple JAR filesuntil these are finally merged in a future API release<br />
  37. 37. Enter bb-cms-admin.jar<br />Many of the classes seen in bb-platform.jar<br />blackboard.data.user.User<br />blackboard.data.role.PortalRole<br />blackboard.data.course.Course<br />blackboard.data.course.CourseMembership<br />blackboard.data.course.CourseMembership$Role<br />are extended by classes in bb-cms-admin.jar<br /><ul><li>blackboard.admin.data.user.Person
  38. 38. blackboard.admin.data.role.PortalRoleMembership
  39. 39. blackboard.admin.data.course.CourseSite
  40. 40. blackboard.admin.data.course.Membership
  41. 41. blackboard.admin.data.course.Enrollment
  42. 42. blackboard.admin.data.course.StaffAssignment</li></li></ul><li>bb-cms-admin.jar<br />blackboard.admin.data.user.Person<br />getRowStatus() would be here<br />
  43. 43. Loaders & Persisters<br />blackboard.persist.user.UserDbLoader – many options<br />But...<br />UserDbLoader will only load User objects where the underlying USERS database table entry has ROW_STATUS = 0<br />
  44. 44. Loaders & Persisters<br />blackboard.admin.persist.user.PersonLoader<br />PersonLoader loads any entry<br />
  45. 45. Loading Persons by Template<br />SELECT * FROM BB_BB60.USERS WHERE AVAILABLE_IND = ‘N' AND LASTNAME = 'Smith' AND ROW_STATUS = 2;<br />
  46. 46. 5<br />Applying this knowledge<br />Account Problems – “I can’t log in...”<br />
  47. 47. ACCESS?<br />Diagnosis requirements – User Account<br />User<br />Availability<br />User.getIsAvailable() or Person.getIsAvailable()<br />Row Status<br />Person.getRowStatus()<br />Data Source Key<br />Two parts:<br />Person.getDataSourceBatchUid() - may be enoughUser only exposes getDataSourceId()<br />blackboard.admin.persist.datasource.DataSourceLoader. loadByBatchUid() no loadById() method<br />blackboard.admin.data.datasource.DataSource.getDescription()<br />OWNER?<br />
  48. 48. Model of the Process<br />Not Rocket Science...<br />Entry Point:<br />Module<br />Username Known?<br />NO<br />Search Tool<br />YES<br />Identify User<br />Display Information<br />Fix Problem<br />
  49. 49. Implementation<br />
  50. 50. Display information<br />
  51. 51. Fix Problem<br />
  52. 52. Limits of the APIs<br />blackboard.persist.user.UserSearch<br />UserSearch can also be a bit picky about who it returns results too – you may need a SYSTEM_ROLE to see any!<br />
  53. 53. Wrote my Own!<br />
  54. 54. Populate an ArrayList with Person objects<br />
  55. 55. Very Important<br />Ensure you always hand back the Connection<br />
  56. 56. 6<br />Applying this knowledge<br />Enrolment Problems – “My Current Courses List is wrong...”<br />
  57. 57. Diagnosis requirements - Enrolment<br />User<br />Course<br />ACCESS?<br />ACCESS?<br />OWNER?<br />OWNER?<br />Portal Role<br />Course Membership<br />ACCESS?<br />ACCESS?<br />OWNER?<br />OWNER?<br />
  58. 58. User Account data<br />PersonLoader<br />DataSourceLoader<br />Course Data<br />CourseSiteLoader<br />Enrolment Data<br />EnrollmentLoader<br />StaffAssignmentLoader<br />DataSourceLoader<br />Portal Role data<br /><ul><li>PortalRoleMembershipLoader
  59. 59. DataSourceLoader</li></ul>How many database round-trips would this cost?<br />Loader-tastic!<br />
  60. 60. Displaying Information<br />
  61. 61. Summary of User’s Account Status<br />
  62. 62. Summary of Enrolment<br />
  63. 63. Definitely a candidate for DIY<br />
  64. 64. Definitely a candidate for DIY<br />
  65. 65. All captured in a single custom class<br />
  66. 66. 7<br />Straying off topic<br />What you can do with this knowledge<br />
  67. 67. Manage the Snapshot Rules in Bb<br />
  68. 68. Rules, Roles and Tabs<br />We are about to completely rewrite the way we grant access to portal tabs (tab_groups)<br />This should make diagnosing “Who can see what problems” much easier!<br />
  69. 69. 8<br />Conclusion<br />Almost there!<br />
  70. 70. Snapshot<br />Secret to success = pre-process your data<br />Data Source Keys control what can be changed<br />Snapshot alters ROW_STATUS values<br />Available and Blocked (RowStatus) are not the same<br />APIs<br />ROW_STATUS values are not accessible using classes in bb-platform.jar<br />Classes in bb-cms-admin.jar expose this fields<br />Applications<br />APIs well suited to simple tasks e.g. User Account Issues<br />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<br />
  71. 71. Please provide feedback for this session by emailing DevConFeedback@blackboard.com.  <br />The catchy title of this session is:<br />Diagnosing account, enrolment and snapshot problems using the APIs<br />You contact the author at<br />malcolm.murray@durham.ac.uk <br />

×