© blackboard, inc. all rights reserved. java apis in depth: blackboard learning system and...

Post on 12-Jan-2016

218 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

© Blackboard, Inc. All rights reserved.

Java APIs in Depth:Blackboard Learning System and Community System

David AshmanSenior Software Architect, Product DevelopmentBlackboard Inc.

2

Any statements in this presentation about future expectations, plans and prospects for Blackboard and other statements containing the words “believes,” “anticipates,” “plans,” “expects,” “will,” and similar expressions, constitute forward-looking statements within the meaning of The Private Securities Litigation Reform Act of 1995. Actual results may differ materially from those indicated by such forward-looking statements as a result of product development changes and other important factors discussed in our filings with the SEC. We may make statements regarding our product development and service offering initiatives, including the content of future product upgrades, updates or functionality in development.  While such statements represent our current intentions, they may be modified, delayed or abandoned without prior notice and there is no assurance that such offering, upgrades, updates or functionality will become available unless and until they have been made generally available to our customers.

About Forward Looking Statements

3

Overview

» Background

» API Overview» High level review of packages, patterns

» System Extension Overview

4

Audience

» Knowledge of Java programming

» People who want an overview of the entire range of functionality exposed » (without resorting to reading the docs)

» Thinking of building, don’t know what to look at first…

5

A Little History…

Import/Export

R6 Portal

R6 Gradebook

R6 Assessment

Module Developer Kit

Blackboard Building Blocks™

R7 Discussion Board

6

Blackboard Building Blocks™ Architecture

Core Services

Data Objects

Business Layer

Presentation Layer(JSP, Struts, Tag Library)

Log

Security

Config Persistence

Session

I18N VXI

Context Plug-ins

DB

7

Road Map

» Core Services» How do I log it, authenticate it, etc.?

» Persistence» How do I get to the data?

» Data Objects» What data can I see?

© Blackboard, Inc. All rights reserved.

Service APIs

9

Services

» Infrastructure for common utility functions

» Exposed as interfaces (mostly)

» Lookup via BbServiceManager

10

Service Lookups

LogService logService = BbServiceManager.getLogService();

LocaleManager locMgr = BbServiceManager.getLocaleManager();

ContextManager ctxMgr = (ContextManager)BbServiceManager .lookupService( ContextManager.class );

11

Services – Log

» blackboard.platform.log.LogService» Simple write-only log implementation» Supports configurable levels» Decouples system from underlying logging

implementation» Log4j» JDK 1.4 logging

12

Services – Filesystem

» blackboard.platform.filesystem.FileSystemService» Broker different file system locations» Course and content» E.g., getContentDirectory()

13

Services - Security

» blackboard.platform.security.AccessManagerService» Authentication» Authorization

14

Services – Session

» blackboard.platform.session.BbSessionManagerService» State for the current browser-based client

» Stores authentication status

» Cookie-based session management» Persisted to the database to share between Perl and

Java processes

» Some assembly required» Not all HTTP-clients (e.g., media plugins for browsers)

honor the host browser’s cookies

15

Services – Context

» blackboard.platform.context.ContextManager» Represents the current request’s state

» Who am I? » What course am I in?» What database am I supposed to talk to?

» Critical entry point that all code must call» Interact via ContextManager service interface

» ContextManager.setContext()» ContextManager.releaseContext()

© Blackboard, Inc. All rights reserved.

Persistence APIs

17

Persistence APIs

» Interfaces allow replaceable persistence implementations» Currently proprietary to Blackboard» Implements standard DAO Pattern

» BbPersistenceManager» Ties together different aspects of persistence» Loader/Persister broker» Container

18

Persistence APIs – Id

» Used to encapsulate the unique identifier for each data object

» Defines the object’s lifecycle» Id.UNSET_ID – default id for new objects

» Primary key, and more…» Data type» Container (database)» GUIDs are not used, so keys can collide

19

Persistence APIs – Loaders

» Implements DAO Pattern for finding and loading data objects

» All type-specific loaders are geared towards known predicates» loadById()» loadByUserIdandType()

» Why?» Performance – Ad-hoc queries can kill the system…» API stability

20

Persistence APIs – Persisters

» Implements DAO Pattern for inserting, updating and deleting data objects

» “Smart” update» Id object state determines insert vs. update

21

Accessing Persisters and Loaders

» Not directly instantiated» Always implemented as interfaces» BbPersistenceManager is the broker

» Most have a Default object for direct access

ContentDbLoader loader = ContentDbLoader.Default.getInstance()

22

Persistence Example

Content content = new Content();

content.setTitle(“Foo”);

// etc. . .

ContentDbPersister contentPersister =

ContentDbPersister.Default.getInstance();

contentPersister.persist( content );

© Blackboard, Inc. All rights reserved.

Data Object APIs

24

Data Objects

» blackboard.data.*

» Object view of the database

» Typed to wrap legacy database constructs» Type-safe enumerations for constrained database

columns» User.Role.SYSTEM_ADMIN

» Faithful adherence to existing schema has some interesting side effects

25

Data Objects – BbObject

» Base object for all data objects» Common attributes

» Primary Key (Id)» Creation date» Modification date

» “Smart” attributes» Properties stored in an internal map, instead of

member variables» Smart load, dirty flag

26

Data Objects – Content

» blackboard.data.content

» Content is the root object that can be used in the “content” areas of a course» All other objects are simple subclasses of Content that

over-ride specific values

» Different types of content» Folder

» Can the object contain other objects?» Lesson

» Should the contents be displayed sequentially?» Reviewable

» Can the content be reviewed for Adaptive Release rules?

27

Data Objects – Content

28

Data Objects – Content

» Content Handler» Ties content to URI-based “handlers”

» Similar to mime types» resource/x-plugin-scorm

» This is really the B2 “glue” for custom content

» Custom content types should create and manipulate Content objects» Only interact with specific types when you KNOW

you’re dealing with the correct type» Generally safer to only use Content object for custom

content

29

Data Objects – Course and Organization

» blackboard.data.course

» Course and Organization» Organization extends Course and overrides specific

attributes

» Group» Represents a subset of the course members

» CourseMembership» Represents enrollment in a course/organization» Enumerated roles

» CourseMembership.Role.INSTRUCTOR » CourseMembership.Role.STUDENT» CourseMembership.Role.GRADER

30

Data Objects - Gradebook

» blackboard.data.gradebook» Provides access to Blackboard course management

system’s gradebook

» LineItem» Represents individual gradeable items in a course

gradebook

» Score» Wraps the actual outcome for a given line item

31

Data Objects – Discussion Board

» blackboard.data.discussionboard» Exposes Blackboard community system’s discussion board

subsystem

» Conference» Aggregates a collection of forums» Each course/organization has one default Conference

» Forum» Encapsulates a collection of messages related to a common topic

» Message» Individual message in a Forum» Can be threaded» Supports attachments

32

Other Data Objects

» Announcement» Wraps, well, announcements» Can be system or course level

» Calendar» Wrap entries in the calendar» Course and System level

» CourseToc» Represents navigation paths within a course menu» Displayed inside a course

33

Other Core Objects

» blackboard.base.BbList» List implementation that can enforce type safety» Implements java.util.List interface, so use that instead» Will probably be replaced with Java 5.0 Generics based

List

» blackboard.base.BbEnum» Base class for all type-safe enumerations» Will start using Java 5.0 enum constructs

» blackboard.base.NestedRuntimeException and blackboard.base.NestedException» Pre-JDK 1.4 facility for chaining exceptions

34

Other Core Objects

» blackboard.base.FormattedText» Encapsulation of text data entered via standard Text

boxes» Defines enumeration for Smart, Plain, and HTML text

» blackboard.base.GenericComparator» Comparator implementation that can sort based on

arbitrary properties» Works with String, Boolean, Dates, and Comparable

© Blackboard, Inc. All rights reserved.

Integration APIs

36

Portal

» blackboard.portal.external

» CustomData is all you’ll need…» Stores module and personalization information

for a given module» Store key/value

» Value can be string or binary object

37

User Interface Design

» Tag Libraries» Encapsulate re-usable UI components to capture

the Blackboard look and feel» Caret Pages» List Pages» Headers» Steps and Data Elements for data collection

38

Integration APIs

» blackboard.admin.*» Formerly called the “Event” APIs» Repackaged to be more consistent with B2 APIs» Implements data model for Snapshot

» Maps Blackboard data model to IMS standard» Person» Course (Group)» Membership

» DataSource» Defines logically related entities that can be managed

independently via Snapshot

© Blackboard, Inc. All rights reserved.

Deployment

40

Anatomy of a Plugin

Package (.war/.zip file)

Platform Descriptor

Blackboard Manifest

Web Resources

Libraries

web.xml

Servlets, JSP (Java)

.class, .jar files (Java)

41

Plugin Deployment

» Standard Java-based web application

» WEB-INF/bb-manifest.xml» Additional Blackboard metadata» Defines data that is stored into the database

» Tools» Content Handlers» Portal Modules

» Defines “entry points”» Links that can be rendered from the Blackboard UI

42

Plugin Deployment – General Information <plugin> <name value="Storage Demo Plugin"/> <handle value="storage-demo"/> <default-locale value=“en_US”/> <description value="This plugin demonstrates using a third party storage engine."/> <version value="1.0.0.1"/> <requires> <bbversion value="6.0.0"/> </requires> <vendor> <id value="bb"/> <name value="Blackboard, Inc."/> <url value="http://www.Blackboard.com/" /> <description value="We brought you Blackboard Building Blocks." /> </vendor>

43

Plugin Deployment – Content Handlers

<content-handlers> <content-handler> <name value="plugin.content-handler1.name"/> <handle value= "resource/x-smpl-type1"/> <http-actions> <create value="ch1/create.jsp"/> <modify value="ch1/modify.jsp"/> <remove value="ch1/remove.jsp"/> </http-actions> <icons> <toolbar value="/images/add_ch1.gif"/> <listitem value="/images/icon.gif"/> </icons> </content-handler> </content-handlers>

44

Plugin Deployment – Tools

<application-defs> <application handle="storageapp" type="course" use-ssl="false" name="B2 Storage Examples" can-allow-guest="true" small-icon="/images/bookopen_u.gif" large-icon="/images/bookopen_u.gif"> <description lang="en_US">Application installed to demonstrate storage techniques</description> <links> <link> <type value="tool"/> <name value="B2 Storage Examples"/> <url value="links/index.jsp" /> <description value="B2 Storage Examples" /> <icons> <listitem value="/images/bookopen_u.gif"/> </icons> </link> </links> </application> </application-defs>

45

Plugin Deployment – Portal Modules

<module-defs> <module-type ext-ref="smpl-module" title="plugin.sample-module.title“ uicreatable="true"> <jsp-dir>module</jsp-dir> <jsp> <view>view.jsp</view> <edit>edit.jsp</edit> <admin>admin.jsp</admin> </jsp> </module-type> </module-defs>

46

Plugin Deployment - Permissions

<permissions> <permission type="socket" name=“www.w3.org”

actions="resolve,connect"/> <permission type="java.io.FilePermission"

name="&amp;lt;&amp;lt;ALL FILES&amp;gt;&amp;gt;“ actions="read,write,delete"/>

<permission type="persist" name="Content" actions="create,modify,delete"/>

<permission type="persist" name="Outcome" actions="load,persist,delete"/>

</permissions>

47

Plugin Deployment - Localization

<plugin> <name value=“plugin.name"/> <handle value="storage-demo"/> <description value=“plugin.description"/> <default-locale value=“en_US”/> <version value="1.0.0.1"/>

» <default-locale/> element indicates the extension is localized» Name and description values in bb-manifest.xml are used as

bundle keys» Bundles are deployed under WEB-INF/bundles using

bb-manifest-xx_XX.properties pattern for all supported locales

48

Plugin Deployment

49

What have we covered?

» Core Service APIs» Persistence APIs – DAO Pattern» Data Objects» Integration APIs» Deployment

© Blackboard, Inc. All rights reserved.

Questions?

top related