+ All Categories
Home > Education > Diagnosing account, enrolment and snapshot problems using the APIs

Diagnosing account, enrolment and snapshot problems using the APIs

Date post: 16-Dec-2014
Category:
Upload: malcolm-murray
View: 1,501 times
Download: 0 times
Share this document with a friend
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 enrolments
Popular Tags:
49
Diagnosing account, enrolment and snapshot problems using the APIs Dr Malcolm Murray Durham University Photo by Terry Bain: http://www.flickr.com/photos/axis/2897335784/
Transcript
Page 1: Diagnosing account, enrolment and snapshot problems using the APIs

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

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

Modelling UsersLooking at the APIs

and peeking under the covers into the database1

Page 4: Diagnosing account, enrolment and snapshot problems using the APIs

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

bb-platform.jar

blackboard.data.user.User

Page 6: Diagnosing account, enrolment and snapshot problems using the APIs

bb-platform.jar

blackboard.data.user.User

Page 7: Diagnosing account, enrolment and snapshot problems using the APIs

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

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

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

SnapshotNothing more than a quick overview

RTFM for more information 2

Page 11: Diagnosing account, enrolment and snapshot problems using the APIs

Snapshot

Making sense of complicated data

Course Roles

Courses

UsersPortal Roles

Quota

Page 12: Diagnosing account, enrolment and snapshot problems using the APIs

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

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

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

Data Source KeysMean nothing to you?

Stay awake through this bit then3

Page 16: Diagnosing account, enrolment and snapshot problems using the APIs

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

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

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

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

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

bb-cms-admin.jar

blackboard.admin.data.user.Person

getRowStatus() would be here

Page 22: Diagnosing account, enrolment and snapshot problems using the APIs

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

Loaders & Persisters

blackboard.admin.persist.user.PersonLoader

PersonLoader loads any

entry

Page 24: Diagnosing account, enrolment and snapshot problems using the APIs

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

Applying this knowledge

Account Problems – “I can’t log in...”5

Page 26: Diagnosing account, enrolment and snapshot problems using the APIs

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

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

Implementation

Page 29: Diagnosing account, enrolment and snapshot problems using the APIs

Display information

Page 30: Diagnosing account, enrolment and snapshot problems using the APIs

Fix Problem

Page 31: Diagnosing account, enrolment and snapshot problems using the APIs

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

Wrote my Own!

Page 33: Diagnosing account, enrolment and snapshot problems using the APIs

Populate an ArrayList with Person objects

Page 34: Diagnosing account, enrolment and snapshot problems using the APIs

Very Important

Ensure you always hand back the Connection

Page 35: Diagnosing account, enrolment and snapshot problems using the APIs

Applying this knowledgeEnrolment Problems – “My Current Courses List is wrong...”6

Page 36: Diagnosing account, enrolment and snapshot problems using the APIs

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

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

Displaying Information

Page 39: Diagnosing account, enrolment and snapshot problems using the APIs

Summary of User’s Account Status

Page 40: Diagnosing account, enrolment and snapshot problems using the APIs

Summary of Enrolment

Page 41: Diagnosing account, enrolment and snapshot problems using the APIs

Definitely a candidate for DIY

Page 42: Diagnosing account, enrolment and snapshot problems using the APIs

Definitely a candidate for DIY

Page 43: Diagnosing account, enrolment and snapshot problems using the APIs

All captured in a single custom class

Page 44: Diagnosing account, enrolment and snapshot problems using the APIs

Straying off topic

What you can do with this knowledge7

Page 45: Diagnosing account, enrolment and snapshot problems using the APIs

Manage the Snapshot Rules in Bb

Page 46: Diagnosing account, enrolment and snapshot problems using the APIs

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

Conclusion

Almost there!8

Page 48: Diagnosing account, enrolment and snapshot problems using the APIs

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

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

[email protected]


Recommended