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

50
© Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product Development Blackboard Inc.

Upload: edmund-leonard

Post on 12-Jan-2016

221 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

© Blackboard, Inc. All rights reserved.

Java APIs in Depth:Blackboard Learning System and Community System

David AshmanSenior Software Architect, Product DevelopmentBlackboard Inc.

Page 2: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 3: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

3

Overview

» Background

» API Overview» High level review of packages, patterns

» System Extension Overview

Page 4: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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…

Page 5: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

5

A Little History…

Import/Export

R6 Portal

R6 Gradebook

R6 Assessment

Module Developer Kit

Blackboard Building Blocks™

R7 Discussion Board

Page 6: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 7: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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?

Page 8: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

© Blackboard, Inc. All rights reserved.

Service APIs

Page 9: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

9

Services

» Infrastructure for common utility functions

» Exposed as interfaces (mostly)

» Lookup via BbServiceManager

Page 10: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

10

Service Lookups

LogService logService = BbServiceManager.getLogService();

LocaleManager locMgr = BbServiceManager.getLocaleManager();

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

Page 11: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 12: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

12

Services – Filesystem

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

Page 13: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

13

Services - Security

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

Page 14: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 15: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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()

Page 16: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

© Blackboard, Inc. All rights reserved.

Persistence APIs

Page 17: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 18: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 19: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 20: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

20

Persistence APIs – Persisters

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

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

Page 21: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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()

Page 22: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

22

Persistence Example

Content content = new Content();

content.setTitle(“Foo”);

// etc. . .

ContentDbPersister contentPersister =

ContentDbPersister.Default.getInstance();

contentPersister.persist( content );

Page 23: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

© Blackboard, Inc. All rights reserved.

Data Object APIs

Page 24: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 25: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 26: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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?

Page 27: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

27

Data Objects – Content

Page 28: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 29: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 30: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 31: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 32: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 33: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 34: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 35: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

© Blackboard, Inc. All rights reserved.

Integration APIs

Page 36: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 37: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 38: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 39: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

© Blackboard, Inc. All rights reserved.

Deployment

Page 40: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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)

Page 41: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 42: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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>

Page 43: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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>

Page 44: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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>

Page 45: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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>

Page 46: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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>

Page 47: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

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

Page 48: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

48

Plugin Deployment

Page 49: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

49

What have we covered?

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

Page 50: © Blackboard, Inc. All rights reserved. Java APIs in Depth: Blackboard Learning System and Community System David Ashman Senior Software Architect, Product

© Blackboard, Inc. All rights reserved.

Questions?