My First Building Block as a Portal Module Heather Natour Senior Lead Engineer

Download Report

Transcript My First Building Block as a Portal Module Heather Natour Senior Lead Engineer

My First Building Block as a
Portal Module
Heather Natour
Senior Lead Engineer
Blackboard Inc.
September 29, 2005
Road Map
•
•
•
•
What are Portals?
Module Types
Creating Modules
API
Audience
• Building Blocks Developers that want to
create Blackboard Community System
Modules
• Java/JSP Programmers
• Some knowledge of Building Blocks
Programming
• …Or Just Interested to see what’s
possible with Community System
Modules
What are Portals?
• Provides an Entry Point
• Provides a Customized User Experience
• Unites several sources of information and
present them in one central place
• Sites can customize Portal for a specific type
of user or market
– Student, Faculty, East, West
• “Sticky”
Example of a “sticky” Portal
Blackboard Community System
Components
Tab
Contents
Layout
Module
Module Edit
Minimize
Delete
Module Types
• Code for the Module
• Every Module has an associated Type – A
Type could have more than one instance
• One or more JSP pages
Pre Built Module Types
• Include HTML
• Include URL
• RSS Channel
Module Type JSP Pages
• View
– What gets displayed when the module is
rendered
• Admin
– Edit Global properties
• Edit
– User customizable properties
View
• Rendered Inline
• No HTML Header or Body Tags
Edit
Calls the edit page
Edit
Admin
Manage Modules
Page
Admin Page for
Global
Configuration
Admin
Creating Module Types
• JSP is easiest
• Tags Provided for Edit and Admin
Pages (more info in Dev Guide)
– modulePersonalizationPage
– modulePersonalizationReceipt
– moduleAdminPage
– moduleAdminReceipt
Portal API
•
•
•
•
Java
Class: CustomData
In package blackboard.portal.external
Javadoc available in SDK
Portal API
• To get the Global CustomData for a
module, use getModuleData(context)
CustomData data =
CustomData.getModuleData(pageContext);
String text =
data.getValue(“body.lunchMenu”);
String text =
data.getValue(“body.type”);
Portal API
• Can also save Global properties for a
module using this same object
CustomData data =
CustomData.getModuleData(pageContext);
String text = data.setValue(“body.lunchMenu”,
“Roast Turkey”);
String text = data.setValue(“body.type”,”Entrée”);
data.save();
Portal API
• Similar Methods exist to set user
specific data
CustomData data =
CustomData.getModulePersonalizationData(pageContext);
String text = data.setValue(“userpref.display”,
“ALL”);
data.save();
Packaging the Module Type
• Put it in a System Extension Package
• JSPs in /module directory
<module-type ext-ref="smpl-module" title="Sample
Plug-in Module Type" uicreatable="true">
<jsp-dir>module</jsp-dir>
<jsp>
<view>view.jsp</view>
<edit>edit.jsp</edit>
<admin>admin.jsp</admin>
</jsp>
</module-type>
Creating a Module
• Can specify a module type already in
the system or in the same installation
package
• Many modules can be created using the
Bb supplied types
• Could leverage types that become
available in the community
Creating a Module
• Module is packaged as a standard
Building Blocks Package
• bb-manifest.xml
– module
– channel
Specifying a Module
• Manifest Entry (Module Def):
<module type="portal/channel" isadmin="true"
useraddable="true" isdeletable="true" title="Sample
Channel Module">
<description>Sample channel module. This module
accesses the RSS channel installed with this plugin.</description>
<ExtraInfo>
<property key="channel.id"
type="String">macnews</property>
</ExtraInfo>
</module>
Specifying a Module
• Channel Manifest Entry (Channel Def):
<rss-channel ext-ref=“macnews" title=“Mac News">
<data-url>
http://www.macnn.xml/macnn.xml </data-url>
</rss-channel>
Specifying a Module
• Can also optionally specify Institution
Roles (Primary and Secondary)
<module-groups>
<module-group id=“student"/>
<module-group id=“faculty"/>
</module-groups>
Demonstration!
Thank you!