Very cool title goes here and look you have plenty of room

Download Report

Transcript Very cool title goes here and look you have plenty of room

Java APIs in Depth:
Blackboard Learning System and Community System
David Ashman
Senior Software Architect, Product Development
Blackboard Inc.
© Blackboard, Inc. All rights reserved.
About Forward Looking Statements
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.
2
Overview
»
Background
»
API Overview
»
»
High level review of packages, patterns
System Extension Overview
3
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…
4
A Little History…
R7 Discussion Board
Import/Export
Blackboard Building Blocks™
Module Developer Kit
R6 Gradebook
R6 Assessment
R6 Portal
5
Blackboard Building Blocks™ Architecture
Presentation Layer
(JSP, Struts, Tag Library)
Business Layer
Core Services
Security
Log
Config
Session
Context
Persistence
Plug-ins
I18N
Data Objects
VXI
DB
6
Road Map
»
Core Services
»
»
Persistence
»
»
How do I log it, authenticate it, etc.?
How do I get to the data?
Data Objects
»
What data can I see?
7
Service APIs
© Blackboard, Inc. All rights reserved.
Services
»
Infrastructure for common utility functions
»
Exposed as interfaces (mostly)
»
Lookup via BbServiceManager
9
Service Lookups
LogService logService =
BbServiceManager.getLogService();
LocaleManager locMgr =
BbServiceManager.getLocaleManager();
ContextManager ctxMgr =
(ContextManager)BbServiceManager
.lookupService( ContextManager.class );
10
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
11
Services – Filesystem
»
blackboard.platform.filesystem.FileSystemService
»
»
»
Broker different file system locations
Course and content
E.g., getContentDirectory()
12
Services - Security
»
blackboard.platform.security.AccessManagerService
»
»
Authentication
Authorization
13
Services – Session
»
blackboard.platform.session.BbSessionManagerService
» State for the current browser-based client
»
»
Cookie-based session management
»
»
Stores authentication status
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
14
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()
15
Persistence APIs
© Blackboard, Inc. All rights reserved.
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
17
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
18
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
19
Persistence APIs – Persisters
»
Implements DAO Pattern for inserting, updating
and deleting data objects
»
“Smart” update
»
Id object state determines insert vs. update
20
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()
21
Persistence Example
Content content = new Content();
content.setTitle(“Foo”);
// etc. . .
ContentDbPersister contentPersister =
ContentDbPersister.Default.getInstance();
contentPersister.persist( content );
22
Data Object APIs
© Blackboard, Inc. All rights reserved.
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
24
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
25
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
»
»
Lesson
»
»
Can the object contain other objects?
Should the contents be displayed sequentially?
Reviewable
»
Can the content be reviewed for Adaptive Release rules?
26
Data Objects – Content
27
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
28
Data Objects – Course and Organization
»
blackboard.data.course
»
Course and Organization
»
»
Group
»
»
Organization extends Course and overrides specific attributes
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
»
29
Data Objects - Gradebook
»
blackboard.data.gradebook
»
»
LineItem
»
»
Provides access to Blackboard course management system’s
gradebook
Represents individual gradeable items in a course gradebook
Score
»
Wraps the actual outcome for a given line item
30
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
»
31
Other Data Objects
»
Announcement
»
»
»
Calendar
»
»
»
Wraps, well, announcements
Can be system or course level
Wrap entries in the calendar
Course and System level
CourseToc
»
»
Represents navigation paths within a course menu
Displayed inside a course
32
Other Core Objects
»
blackboard.base.BbList
»
»
»
»
blackboard.base.BbEnum
»
»
»
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
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
33
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
34
Integration APIs
© Blackboard, Inc. All rights reserved.
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
36
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
37
Integration APIs
»
blackboard.admin.*
»
»
»
»
Maps Blackboard data model to IMS standard
»
»
»
»
Formerly called the “Event” APIs
Repackaged to be more consistent with B2 APIs
Implements data model for Snapshot
Person
Course (Group)
Membership
DataSource
»
Defines logically related entities that can be managed
independently via Snapshot
38
Deployment
© Blackboard, Inc. All rights reserved.
Anatomy of a Plugin
Package (.war/.zip file)
Platform Descriptor
web.xml
Blackboard Manifest
Web Resources
Libraries
Servlets, JSP (Java)
.class, .jar files (Java)
40
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
41
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>
42
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>
43
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>
44
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>
45
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>
46
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
47
Plugin Deployment
48
What have we covered?
»
»
»
»
»
Core Service APIs
Persistence APIs – DAO Pattern
Data Objects
Integration APIs
Deployment
49
Questions?
© Blackboard, Inc. All rights reserved.