Copyright 2005 Academic Computing - University of South Florida Tips & Tricks in Building Blocks Development Blackboard Developers Conference July 19,

Slides:



Advertisements
Similar presentations
PubMed/How to Search, Display, Download & (module 4.1)
Advertisements

Desire2Learn (D2L) General Training: Part A. The D2L Environment: Your Course Materials Watch for references to the printable guides on training- session.
Microsoft Access.
A Toolbox for Blackboard Tim Roberts
Bboogle Teams: Supporting Small Group Communications through Google Apps Integration with the Blackboard Learn Platform Jonathan Smith, Software Architect,
Holiday Calendar Menu for navigation This is School Management System’s home screen. This application will automate School or College. It contains a Menu.
1 Viewing an Archive Within Bb Learn Within Moodle Outside of an LMS.
Leverage Blackboard Web Services
A Blackboard Building Block™ Crash Course for Web Developers
Extending JIRA Rachel Wright July 15, 2014 See slide “Notes” section for commentary and talking points.
My First Building Block Presented By Tracy Engwirda 28 September, 2005.
UNMC Blackboard Users Group June 23, Agenda Discuss the upcoming Blackboard training opportunities Demonstrate the enhanced Extron WYSIWYG, including.
Microsoft Access Manual 1 By Dhawala Kovuri Elham S.Khorasani Ismail Guneydas.
Access Tutorial 1 Creating a Database
Creating a Blank Database 1. Open up Microsoft Access 2. Click on Blank document button 3. On the right panel, Specify the location for saving your database.
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
Attribute databases. GIS Definition Diagram Output Query Results.
Data Persistence and Object-Relational Mapping Slides by James Brucker, used with his permission 1.
Blackboard Look and Feel through Tag Libraries Presented By Tracy Engwirda 29 September, 2005.
1 INTRO TO BUSINESS COMPONENTS FOR JAVA (BC4J) Matt Fierst Computer Resource Team OracleWorld Session
© Blackboard, Inc. All rights reserved. My First Building Block as a Content Type Heather Natour Senior Lead Engineer Blackboard Inc. July 18 th 1:30pm.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Databases C HAPTER Chapter 10: Databases2 Databases and Structured Fields  A database is a collection of information –Typically stored as computer.
CPSC 203 Introduction to Computers T59 & T64 By Jie (Jeff) Gao.
Collections Management Museums EMu 4.0 EMu (And where to from there!) Alex Fell Operations Manager KE Software (UK)
WaveMaker Visual AJAX Studio 4.0 Training Authentication.
© Blackboard, Inc. All rights reserved. My First Java Building Block for the Blackboard Content System Stephanie Cupp Senior Product Analyst Blackboard.
Python MySQL Database Access
PI ICE and Web Applications – Gregg Le Blanc PI ICE Gregg Le Blanc PI System Product Manager.
Visual Web Design Dreamweaver Level 2. Hospitality Restrooms Food and Drink Turn cell phones off or set to vibrate Smoking Comfort Breaks Class Hours.
General Systems Information ALEPH v20.01 Library Staff Training © South Dakota Library Network, 2013 ©Ex Libris (USA), 2011 Modified for SDLN Version
Dali JPA Tools. About Dali Dali JPA Tools is an Eclipse Web Tools Platform sub-Project Dali 1.0 is a part of WTP 2.0 Europa coordinated release Goal -
SYST Web Technologies SYST Web Technologies Databases & MySQL.
© Blackboard, Inc. All rights reserved. Deploying a complex building block Andre Koehorst Learning Lab Universiteit Maastricht, the Netherlands July 18.
Binding UI Components to Data. Adding UI Components to the Page You can create components on a page by: Dragging a component from the Component Palette.
Key Applications Module Lesson 21 — Access Essentials
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL ADO.Net Basics Ruwan Wijesinghe Trainer.
USING XML AS A DATA SOURCE. Data binding is a process by which information in a data source is stored as an object in computer memory. In this presentation,
Database Beginnings. Scenario so far In our scenario we have people registering for training sessions. –The data about the training sessions was placed.
This eCPIC Quick Guide has been developed to assist System Administrators with creating Hierarchy Grids in eCPIC. The Hierarchy Grid functionality allows.
® Microsoft Office 2013 Access Creating a Database.
26 Mar 04 1 Application Software Practical 5/6 MS Access.
Access Forms and Queries. Entering Data in Your Table  You can add data to your table in Datasheet view, by typing in the columns and rows.  This.
Customizing Aspen Templates TEC04 Elizabeth Lucchese.
Blackboard and Content Types John Knight Blackboard Inc.
Database Management Systems CS 420. Topics Outline 1. Introduction 2. HTML Review 3. VBScript 4. Access DBMS 5. Relational Database 6. Design Process.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Security Overview Functional security – users, groups, and permissions for sites, lists,
CSCI 6962: Server-side Design and Programming JSF DataTables and Shopping Carts.
Microsoft FrontPage 2003 Illustrated Complete Integrating a Database with a Web Site.
1 MS Access. 2 Database – collection of related data Relational Database Management System (RDBMS) – software that uses related data stored in different.
Brett Stephens Systems Analyst Learning Platforms Team
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
PHP Programming. Topics Database Handling (MySQL, MSSQL, ODBC)
Blackboard Building Blocks™: Data Integration and Administration Raymond Peterson, Blackboard, Inc.
CPSC 203 Introduction to Computers T97 By Jie (Jeff) Gao.
IS-907 Java EE Introduction to JPA. Java Persistence API A framework for using relational databases in Java programs mapping between tables and classes,
ADVM420- Class #6 Web Design with PHP and MySQL Building a Dynamic Website: Using a database to store webcontent © Copyright 2003 Grant Macewan College.
Simulation Production System Science Advisory Committee Meeting UW-Madison March 1 st -2 nd 2007 Juan Carlos Díaz Vélez.
CHAPTER 9 File Storage Shared Preferences SQLite.
Generating XML Data from a Database Eugenia Fernandez IUPUI.
Welcome POS Synchronize Concept 08 Sept 2015.
INTRODUCTION TO DATABASES (MICROSOFT ACCESS)
Database Management  .
Easy Way to Reset WordPress Admin Password on Localhost? Guided By: WPGLOBALSUPPORTWPGLOBALSUPPORT.
Database Applications – Microsoft Access
What is a Database? A collection of data organized in a manner that allows access, retrieval, and use of that data.
BlackBoard 5 A Definitive e-Learning Software Platform Ozgur Balsoy,
Databases Continued 10/18/05.
Resource Model.
Presentation transcript:

Copyright 2005 Academic Computing - University of South Florida Tips & Tricks in Building Blocks Development Blackboard Developers Conference July 19, 2005 Murali Nagulakonda

Copyright 2005 Academic Computing - University of South Florida1 Outline Connecting to the Database Storing Data in Course and User Registries Storing Data Outside the Database User Interfaces Tag Context and ContextManager Gradebook APIs Miscellaneous

Copyright 2005 Academic Computing - University of South Florida Connecting to the Database

Copyright 2005 Academic Computing - University of South Florida3 Connecting to the Database… Use Blackboard’s API’s to connect to the DB. (NON- PUBLIC APIs) Use Blackboard’s connection pool. Already established connections to the DB. Doesn’t require setup/teardown of connections. Getting a connection from the pool is faster Set the bb-manifest.xml permissions. import blackboard.db.*

Copyright 2005 Academic Computing - University of South Florida4 Connecting to the Database… Setting the Bb-manifest permission:

Copyright 2005 Academic Computing - University of South Florida5 Connecting to the Database… ConnectionManager conman; int i=0; private Connection bbConnectDatabase() throws ConnectionNotAvailableException, InterruptedException { BbDatabase bbDb = DbUtil.safeGetBbDatabase(); conman = bbDb.getConnectionManager(); while(conn == null && i<10){ try { conn = conman.getConnection(); } catch(ConnectionNotAvailableException cnae){ Thread.sleep(1000); ++i; } return conn; }

Copyright 2005 Academic Computing - University of South Florida6 Releasing the connection… if(conman != null) conman.releaseConnection(conn);

Copyright 2005 Academic Computing - University of South Florida Registries

Copyright 2005 Academic Computing - University of South Florida8 Registries Course & User Registries Excellent tables strictly for Key-Value pair data Makes building blocks portable Tables already exist Don’t have to worry about creating them Example of Key “usf.spa.lastviewed" Caveat: These are Non-public APIs. BB can change the APIs & tables anytime.

Copyright 2005 Academic Computing - University of South Florida9 Registries SQL> desc course_registry; Name Type SOS_ID_PK2NUMBER(38) PK1 NUMBER(38) CRSMAIN_PK1 NUMBER(38) CRSMAIN_SOS_ID_PK2 NUMBER(38) DTMODIFIEDDATE ROW_STATUSNUMBER(1) REGISTRY_KEY VARCHAR2(50) REGISTRY_VALUE VARCHAR2(255) DTCREATED DATE

Copyright 2005 Academic Computing - University of South Florida10 Registries SQL> desc user_registry; Name Type SOS_ID_PK2 NUMBER(38) USERS_SOS_ID_PK2NUMBER(38) PK1 NUMBER(38) ROW_STATUSNUMBER(1) REGISTRY_KEY VARCHAR2(50) REGISTRY_VALUE VARCHAR2(255) DTCREATEDDATE USERS_PK1 NUMBER(38) DTMODIFIEDDATE

Copyright 2005 Academic Computing - University of South Florida11 Registries APIs blackboard.persist.registry UserRegistryEntryDbLoader UserRegistryEntryDbPersister CourseRegistryEntryDbLoader CourseRegistryEntryDbPersister blackboard.data.registry CourseRegistryEntry UserRegistryEntry

Copyright 2005 Academic Computing - University of South Florida12 Registries Persisting Data into a Course Registry CourseRegistryEntryDbPersister crePersister = CourseRegistryEntryDbPersister.Default.getInstance(); String value = lineitem_id + ":" + values; String key = “usf.spa.lastviewed" + ":" + user_id; try { crePersister.deleteByKeyAndCourseId(key,cId); // cID – Course Id of type Id } catch(KeyNotFoundException kfe) {} catch(PersistenceException pe) {} CourseRegistryEntry cre = new CourseRegistryEntry(key,value); cre.setCourseId(cId); try { crePersister.persist(cre); } catch(PersistenceException pe) {}

Copyright 2005 Academic Computing - University of South Florida13 Course Registry Getting Data from a Course Registry CourseRegistryEntryDbLoader creLoader = CourseRegistryEntryDbLoader.Default.getInstance(); Registry registry = creLoader.loadRegistryByCourseId(cId); String key = “usf.spa.lastviewed" + ":" + user_id; String value = registry.getValue(key); Similar for User Registry

Copyright 2005 Academic Computing - University of South Florida Storing Data Outside the Database

Copyright 2005 Academic Computing - University of South Florida15 Storing Data outside the Database Data under the /webapps directory gets wiped out during an update / re-install Use Blackboard APIs to create the Config Directory Data not removed after uninstall or update of module

Copyright 2005 Academic Computing - University of South Florida16 Storing Data in the Config Directory

Copyright 2005 Academic Computing - University of South Florida17 File dir = null; java.util.Enumeration names = request.getParameterNames(); try { dir = blackboard.platform.plugin.PlugInUtil.getConfigDirectory("usf", “member-participation"); } catch(Exception e) { out.println("Exception = " + e); } File cfg = new File(dir,“custom.properties"); FileOutputStream f = null; if(!cfg.exists()) cfg.createNewFile(); try { f = new FileOutputStream(cfg); } catch(FileNotFoundException e) { System.out.println("cant find properties file"); } Properties p = new Properties(); for(; names.hasMoreElements();) { String name = (String) names.nextElement(); String value = request.getParameter(name); p.setProperty(name,value); } p.store(f,“Member-Participation Configuration File"); f.close();

Copyright 2005 Academic Computing - University of South Florida18 Storing Data outside the Database…

Copyright 2005 Academic Computing - University of South Florida19 Retrieving Data from Config Directory try { dir = blackboard.platform.plugin.PlugInUtil.getConfigDirectory("usf","member- participation"); } catch(Exception e) { out.println("Exception = " + e); } File cfg = new File(dir,“custom.properties"); FileInputStream fp = null; if(cfg.exists()) { fp = new FileInputStream(cfg); Properties p = new Properties(); p.load(fp); fp.close(); sname = p.getProperty("sname"); dbname = p.getProperty("dbname"); uname = p.getProperty("uname"); pwd = p.getProperty("pwd"); }

Copyright 2005 Academic Computing - University of South Florida

Copyright 2005 Academic Computing - University of South Florida21 tag Extremely useful in displaying lists of data Associate a comparator to a column ( listElement ) to enable sorting comparator

Copyright 2005 Academic Computing - University of South Florida22 BbList llist = uLoader.loadByCourseId(cId); GenericFieldComparator compUserName = new GenericFieldComparator(BaseComparator.ASCENDING, "getUserName", User.class ); Comparator " collectionLabel="Course Last Access" objectId=“user" className=“blackboard.data.User" resultsPerPage="-1"> "> Data to be displayed in the row userThe object Id to refer to the data within the “llist” collection throughout the rest of the list tag labelTitle of the column comparatorA non required value which allows the tag to sort the data

Copyright 2005 Academic Computing - University of South Florida23 " collectionLabel="Course Last Access" objectId=“user" className=“blackboard.data.User" resultsPerPage="-1"> resultsPerPage=“-1”: Blackboard doesn’t save state between pages. Use the “- 1” value to tell BB not to page. Default results per page is 20 Currently Blackboard’s list tag doesn’t save state between pages “-1” will show all data in one page.

Copyright 2005 Academic Computing - University of South Florida

Copyright 2005 Academic Computing - University of South Florida25 Creates the framework for the breadcrumb navigation. breadcrumbBar attributes handle: the database field used to uniquely identify the root nav item for the breadcrumb bar You can get a list of all “handles” from the database table “Navigation_Item” environment : Acceptable values are PORTAL, COURSE, CTRL_PANEL, SYS_ADMIN If you’re within a course, the page must have the “course_id” (_3320_1) accessible to it to generate the breadcrumbBar.

Copyright 2005 Academic Computing - University of South Florida26 Student Performance Assistant Requires the Requires For the context to properly generate you should have the “course_id” when coming from the control panel and pass it on to the subsequent pages.

Copyright 2005 Academic Computing - University of South Florida27 Student Performance Student View handle values If it is a course plugin Eg: From the Tools or Communication Area The handle is “vendor_id-plugin_handle-nav-1” Eg: usf-student-performance-nav-1 The numbers continue upwards. Must have course_id. No “handle” if it is a portal module.

Copyright 2005 Academic Computing - University of South Florida28 … From the portal No handle or way to generate the breadcrumb using the Public APIs. To generate the breadcrumb, import: blackboard.persist.navigation blackboard.data.navigation

Copyright 2005 Academic Computing - University of South Florida29 <bbUI:breadcrumbBar String tab_id = referer.substring(referer.indexOf("_"),referer.lastIndexOf("_1")+2); Id tabId = bbPm.generateId (Tab.DATA_TYPE,tab_id); //bbPm – Blackboard Persistence Manager TabDbLoader tabLoader = TabDbLoader.Default.getInstance(); Tab t = tabLoader.loadById(tabId); label = t.getLabel(); TabControl tc = TabControl.createInstance(t); if(request.isSecure()) { strTab = " + request.getServerName() + tc.getFullUrl(request.getServerName()); } else { strTab = " + request.getServerName() + tc.getFullUrl(request.getServerName()); } JSP PAGE "> Select Participation Parameters Referer from Header=

Copyright 2005 Academic Computing - University of South Florida Context & Context Manager

Copyright 2005 Academic Computing - University of South Florida31 Context & ContextManager Context Combination of Session Data & Client Request tag in jsp pages Set the context before calling the API methods Get User: ctx.getUser(); Get Course: ctx.getCourse(); Get CourseMembership: ctx.getCourseMembership(); Get UserId: ctx.getUserId();

Copyright 2005 Academic Computing - University of South Florida32 ContextManager If used within a Java class import blackboard.platform.context ctxMgr = (ContextManager)BbServiceManager.lookupService( ContextManager.class ); Context ctx = ctxMgr.setContext(request); //… work with the APIs if( ctxMgr != null ) ctxMgr.releaseContext();

Copyright 2005 Academic Computing - University of South Florida Gradebook APIs

Copyright 2005 Academic Computing - University of South Florida34 Gradebook APIs Lineitem Score CourseMembership User

Copyright 2005 Academic Computing - University of South Florida35 Gradebook APIs Connection conn = getConnection(); // Use the code sample shown previously to get a connection from the connection pool. LineitemDbLoader lLoader = (LineitemDbLoader) bbPm.getLoader(LineitemDbLoader.TYPE); Lineitem li = lLoader.loadById(lId); // lId is LineitemID BbList sList = li.getScores(); BbList.Iterator sIterator = sList.getFilteringIterator(); CourseMembershipDbLoader cmLoader = CourseMembershipDbLoader.Default.getInstance(); Id cmId ; CourseMembership cm ; User user; String username; while(sIterator.hasNext()) { Score score = (Score) sIterator.next(); cmId = score.getCourseMembershipId(); cm = cmLoader.loadById(cmId,conn,true); // true tells the loader to load all the associated User Data user = cm.getUser(); username = user.getUserName(); }

Copyright 2005 Academic Computing - University of South Florida36 Miscellaneous… All the “Non-Public” APIs shown here and not in the documentation can change when blackboard updates its software. You can use Netbeans to look at the non-public APIs. For building blocks APIs, load the bb-platform.jar. Don’t have to re-install a building block everytime you make changes to the class files. An “Active  Inactive  Active” will get Tomcat to reload the file. Exceptions to this rule are for the bb-manifest.xml file and the web.xml file

Copyright 2005 Academic Computing - University of South Florida37 Miscellaneous Building blocks may have multiple entry points E.g. Portal pages, Control Panel, Tools… Before deploying, make sure you have good logging information which goes to the tomcat logs

Copyright 2005 Academic Computing - University of South Florida38 Resources Bbug.ca Bb-opensource.org mailing list Building Blocks APIs behind.blackboard.com

Copyright 2005 Academic Computing - University of South Florida39 Questions or Comments? Murali Nagulakonda University of South Florida 4202 E. Fowler Ave., LIB 618 Tampa, FL