Index: lams_bb_integration/.classpath
===================================================================
diff -u
--- lams_bb_integration/.classpath (revision 0)
+++ lams_bb_integration/.classpath (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_bb_integration/.project
===================================================================
diff -u
--- lams_bb_integration/.project (revision 0)
+++ lams_bb_integration/.project (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,17 @@
+
+
+ BB_integration
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
Index: lams_bb_integration/WEB-INF/bb-manifest.xml
===================================================================
diff -u
--- lams_bb_integration/WEB-INF/bb-manifest.xml (revision 0)
+++ lams_bb_integration/WEB-INF/bb-manifest.xml (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ application-def description goes here
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_bb_integration/WEB-INF/config/log4j.properties
===================================================================
diff -u
--- lams_bb_integration/WEB-INF/config/log4j.properties (revision 0)
+++ lams_bb_integration/WEB-INF/config/log4j.properties (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,20 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+log4j.rootCategory=INFO, CONSOLE
+#log4j.rootCategory=INFO, CONSOLE, LOGFILE
+
+# Set the enterprise logger category to FATAL and its only appender to CONSOLE.
+log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
+
+# LOGFILE is set to be a File appender using a PatternLayout.
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=axis.log
+log4j.appender.LOGFILE.Append=true
+log4j.appender.LOGFILE.Threshold=INFO
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
\ No newline at end of file
Index: lams_bb_integration/WEB-INF/config/taglibs/bbData.tld
===================================================================
diff -u
--- lams_bb_integration/WEB-INF/config/taglibs/bbData.tld (revision 0)
+++ lams_bb_integration/WEB-INF/config/taglibs/bbData.tld (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,91 @@
+
+
+
+
+ 1.0
+
+ 1.1
+
+ Blackboard Data Tag Library
+
+ /bbData
+
+ The Blackboard Data tag library encapsulates interaction
+ with the Blackboard data and logic layer to allow separation of
+ the UI elements (bbUI) and other page logic.
+
+
+ context
+
+ blackboard.servlet.tags.data.ContextTag
+
+ blackboard.servlet.tags.data.ContextTei
+ JSP
+
+ In order to support forward compatibility for 5.5
+ extension into 6, we need to build a hook that will allow us to
+ capture virtual installation info in 6. Programmatically, this
+ was going to be through the Context object. We need to
+ formalize the interface in 5.5 so that developers can use the
+ API to ensure 6.0 conformance. As a high-level wrapper, we also
+ need a taglib for simple inclusion. The taglib would be a
+ no-arg tag required before any service APIs were called, with a
+ required closing tag at the bottom of the page (ensuring
+ context is released). API calls would be Context.setInstance(
+ HttpServletRequest req ) and Context.releaseInstance(). We need
+ to include some kind of integrity checking/reference counting
+ to ensure proper behavior of nested calls.
+
+ id - may be used to explicitly reference the context object elsewhere
+ in the page (also can access the context from the Java APIs, as
+ usual)
+
+ license - license key, used to ensure that page will not display if
+ the license is not valid
+
+ navItem - initializes a NavigationItemControl that will automatically
+ handle entitlements, and also sets default values for the page title
+ and breadcrumbs on a given page.
+ entitlements - a String[] containing entitlements to check before displaying the page
+ entitlements as per
+ blackboard.platform.security.AccessManagerService.userHasAnyEntitlements()
+ entitlement - a String containing a single entitlement to check before displaying the page
+ entitlement as per
+ blackboard.platform.security.AccessManagerService.userEntitlement()
+
+
+
+
+ id
+ false
+ true
+
+
+ license
+ false
+ true
+
+
+ navItem
+ false
+ true
+
+
+
+ entitlements
+ false
+ true
+
+
+
+ entitlement
+ false
+ true
+
+
+
+
+
+
Index: lams_bb_integration/WEB-INF/config/taglibs/bbUI.tld
===================================================================
diff -u
--- lams_bb_integration/WEB-INF/config/taglibs/bbUI.tld (revision 0)
+++ lams_bb_integration/WEB-INF/config/taglibs/bbUI.tld (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,1823 @@
+
+
+
+
+
+
+
+
+ 1.0
+ 1.1
+ Blackboard UI Tag Library
+ /bbUI
+
+ The Blackboard User Interface tag library encapsulates Blackboard user
+ interface elements to allow developers easy access to the Blackboard look and feel.
+
+
+
+ loginWelcome
+ blackboard.servlet.tags.LoginWelcomeTag
+ empty
+
+ Creates the standard login welcome panel.
+
+
+ errorMessage
+ false
+ true
+
+
+
+
+
+ loginForm
+ blackboard.servlet.tags.LoginFormTag
+ empty
+
+ Creates the standard login form ( same look and feel as rendered by login.pl ).
+
+ validateFormScript - name of the inline script which will validate the login form.
+ errorMessage - error message from previous login attempt
+
+
+ validateFormScript
+ false
+ true
+
+
+ errorMessage
+ false
+ true
+
+
+ target
+ false
+ true
+
+
+
+
+ createAccountForm
+ blackboard.servlet.tags.CreateAccountFormTag
+ empty
+
+ Creates the create-account form.
+
+ createAccountLink - name of the page that will create a new user account.
+
+
+ createAccountLink
+ false
+ true
+
+
+
+
+ copyright
+ blackboard.servlet.tags.CopyrightTag
+ empty
+
+ Standard HTML snippet for Blackboard copyright notice.
+
+
+
+
+ validateLoginFormScript
+ blackboard.servlet.tags.ValidateLoginFormScriptTag
+ empty
+
+ Validates login form.
+
+
+
+
+ inlineScript
+ blackboard.servlet.tags.InlineScriptTag
+ JSP
+
+ Inserts inline script into HTML.
+
+ scriptLanguage - assumed to be JavaScript, if no input is provided.
+ scriptRef1 - reference to existing script.
+ scriptRef2 - reference to another existing script.
+ scriptRef3 - reference to another existing script.
+ scriptRef4 - reference to another existing script.
+
+
+ scriptLanguage
+ false
+ true
+
+
+ scriptRef1
+ false
+ true
+
+
+ scriptRef2
+ false
+ true
+
+
+ scriptRef3
+ false
+ true
+
+
+ scriptRef4
+ false
+ true
+
+
+
+
+ spacer
+ blackboard.servlet.tags.SpacerTag
+ empty
+
+ Creates an invisible area on the page with the specified height
+ and width.
+
+ height - Vertical size of the spacer in pixels [1];
+ width - Horizontal size of the spacer in pixels [1];
+
+
+ height
+ false
+ true
+
+
+ width
+ false
+ true
+
+
+ align
+ false
+ true
+
+
+
+
+ devDocTemplate
+ blackboard.servlet.tags.DocumentTemplateTag
+ JSP
+
+ combines the docTemplateHead and docTemplateBody tag (for use
+ when you don't need to add items to the HEAD of the HTML doc.
+
+
+ title
+ true
+ true
+
+
+
+
+ docTemplate
+ blackboard.servlet.tags.ProductionDocTemplateTag
+ JSP
+ combines the docTemplateHead and docTemplateBody tag (for use
+ when you don't need to add items to the HEAD of the HTML doc.
+
+
+
+ title
+ false
+ true
+
+
+ onLoad
+ false
+ true
+
+
+ onUnload
+ false
+ true
+
+
+ onSubmit
+ false
+ true
+
+
+
+
+ docTemplateHead
+ blackboard.servlet.tags.ProductionDocTemplateHeadTag
+ JSP
+
+ sets head defaults, such as including the base css sheet and validateForm.js
+ links. Use this tag if you wish to add more style sheets or javascript to
+ the head of your HTML doc.
+
+
+ title
+ false
+ true
+
+
+
+
+ docTemplateBody
+ blackboard.servlet.tags.ProductionDocTemplateBodyTag
+ JSP
+
+ Sets the default body tag settings for the HTML page (such as attaching the
+ default style class to the body tag)
+
+
+ onLoad
+ false
+ true
+
+
+ onUnload
+ false
+ true
+
+
+
+
+ coursePage
+ blackboard.servlet.tags.CoursePageTag
+ JSP
+
+ Creates a course page element. It may be used to re-arrange elements on a page
+ from interface to interface. It makes the course available to sub-tags.
+
+ course - Course data object [used in sub-tags to render course-specific elements];
+
+
+ courseId
+ false
+ true
+
+
+ course
+ false
+ true
+
+
+
+
+ courseTitleBar
+ blackboard.servlet.tags.CourseTitlebarTag
+ JSP
+
+ Creates a course title bar
+
+
+
+
+ titleBar
+ blackboard.servlet.tags.TitlebarTag
+ JSP
+
+ Creates a general use title bar.
+ iconUrl - the URL for the Icon image used in the titlebar;
+ pluginId - the Id for the plugin (known by the plugin developer;
+ and used as the directory root of the plugin, e.g.
+ "/Blackboard/plugins/*pluginId*/images/pluginimg.gif")
+
+
+ iconUrl
+ false
+ true
+
+
+ pluginId
+ false
+ true
+
+
+
+
+ step
+ blackboard.servlet.tags.StepTag
+ JSP
+
+ Creates html for a wizard Step element.
+ number - the number for the step (1, 2, 3 for 1st, 2nd, 3rd in wizard);
+ title - the title of the step;
+
+
+ number
+ false
+ true
+
+
+ title
+ true
+ true
+
+
+ width
+ false
+ true
+
+
+
+
+ stepSubmit
+ blackboard.servlet.tags.StepSubmitTag
+ empty
+
+ Creates html for ane entire submit/cancel step element.
+ number - the number for the step (1, 2, 3 for 1st, 2nd, 3rd in wizard);
+ title - the title of the step;
+ cancelUrl - the url to recall the page to if the user cancels;
+ instructions - the message string displayed in this step;
+
+
+ number
+ false
+ true
+
+
+ title
+ false
+ true
+
+
+ cancelUrl
+ false
+ true
+
+
+ instructions
+ false
+ true
+
+
+
+
+
+ breadcrumbBar
+ blackboard.servlet.tags.BreadcrumbBarTag
+ JSP
+
+ Creates the framework for the breadcrumb navigation.
+ environment - whether we are viewing this navigation in the
+ course, control panel, portal, etc.
+ Acceptable values are:
+ PORTAL,
+ COURSE,
+ CTRL_PANEL,
+ SYS_ADMIN;
+ handle - the database field used to uniquely identify the
+ root nav item for the breadcrumb bar. (bar gets the appropriate
+ nav item from the handler, then traverses the navigation tree to
+ iteratively get the item's parents;
+ target - the default target for bc items in this bar, defaults to none
+
+
+ environment
+ false
+ true
+
+
+ handle
+ false
+ true
+
+
+
+ isContent
+ false
+ true
+
+
+ target
+ false
+ true
+
+
+
+
+
+
+ breadcrumb
+ blackboard.servlet.tags.BreadcrumbTag
+ JSP
+
+ Navigation item for the breadcrumb bar.
+ href - the optional attribute setting the link for the element;
+ target - the target attribute for the links in this breadcrumb, defaults
+ to none
+
+
+ href
+ false
+ true
+
+
+ target
+ false
+ true
+
+
+
+
+
+ dataElement
+ blackboard.servlet.tags.DataElementTag
+ JSP
+
+ This tag will be superceded by type-safe form input tags.
+ label - the text label for the data (form) element;
+ should contain: form input tags.
+ required - indicates that the element is required before submitting
+ form. (Doesn't validate, simply adds *);
+
+
+ label
+ false
+ true
+
+
+ required
+ false
+ true
+
+
+
+
+ instructions
+ blackboard.servlet.tags.InstructionsTag
+ JSP
+
+ Instructions should only be called inside a step.
+
+
+
+
+
+ stepContent
+ blackboard.servlet.tags.StepContentTag
+ JSP
+
+ StepContent should only be called inside a step. It wraps the enclosed
+ HTML in the appropriate table row and table data code to fit inside the
+ step tag. It is comparable to the specialized tags Instructions and
+ DataElement, but is more generalized since it ONLY contains table code.
+
+
+
+
+
+ button
+ blackboard.servlet.tags.ButtonTag
+ empty
+
+ This tag will be superceded by type-safe button tags.
+ It hides the details of a button object (eventually will be functional
+ in javascript and non-javascript modes).
+
+ type - whether the buton is FORM_ACTION, INLINE, LONG_INLINE, or TOOLBAR;
+
+ FORM_ACTION corresponds to the "submit"|"cancel" button type
+ ACTION_INLINE corresponds to the "modify"|"remove" button type
+ LONG_INLINE corresponds to inline buttons that don't have the standard button size (e.g., "properties")
+ TOOLBAR corresponds to the toolbar buttons (e.g. "add item") BUT NOT buttons used in actionbars (only old style toolbar buttons)
+
+
+ name - the name of the button, which should correspond to the name of the
+ image for the button, minus the "_off.gif";
+ alt - used for the alt tag for the code;
+ action - whether the button submits a form or links to another page;
+ targetUrl - the target for the page to link to, if it's a link-type button;
+ tabindex - corresponds to the html tabindex property, used to set the tab order
+ of a given link or button
+
+
+ type
+ true
+ true
+
+
+ name
+ true
+ true
+
+
+ alt
+ true
+ true
+
+
+ action
+ true
+ true
+
+
+ targetUrl
+ false
+ true
+
+
+ tabindex
+ false
+ true
+
+
+
+
+
+ receipt
+ blackboard.servlet.tags.ReceiptTag
+ JSP
+
+ Creates a receipt page using titleBar and button components.
+ iconUrl - the URL for the Icon image used in the titlebar;
+ pluginId - the Id for the plugin (known by the plugin developer
+ and used as the directory root of the plugin, e.g.
+ "/Blackboard/plugins/*pluginId*/images/pluginimg.gif");
+ recallUrl - OK button, if null will attempt to locate recallUrl from nav item
+ or use javascript back ONLY SHOWN IF submitUrl and cancelUrl are both null
+ submitUrl, cancelUrl - optional attributes to allow the receipt to have
+ two buttons (although either may be used alone).LINK rather than FORM_SUBMIT action
+
+
+
+ type
+ false
+ true
+
+
+ iconUrl
+ false
+ true
+
+
+ pluginId
+ false
+ true
+
+
+ title
+ false
+ true
+
+
+ recallUrl
+ false
+ true
+
+
+ cancelUrl
+ false
+ true
+
+
+
+ buttonName
+ false
+ true
+
+
+
+ buttonAlt
+ false
+ true
+
+
+
+
+
+ list
+ blackboard.servlet.tags.ListTag
+ blackboard.servlet.tags.ListTei
+ JSP
+
+ Creates a list (UI determined by the TYPE attribute).
+ collection - the collection passed to the list
+ (usually a Blackboard filteredList resulting from a Load attempt
+ within the persistence layer. example: a list of users in a course)
+ collectionLabel - a label for the objects inthe list, default is "Objects"
+ object - the BbObject that will be iterated over in the list (example: user)
+ type - the type of list (determines the UI)
+ description - description of the list (required for accessibility compliance)
+ sortUrl - the URL to sort or paginate this list, probably of the form
+ "myPage.jsp?id=_1_2&name=test" or to control the list display, also specify
+ "myPage.jsp?id=_1_2&name=test&sortBy=" + listElement_index +
+ "&startIndex=" + ind
+ resultsPerPage - the number of items to display on a given page. Default is 20, and
+ -1 is "show all"
+
+
+ collection
+ true
+ true
+
+
+ objectId
+ true
+ true
+
+
+ className
+ true
+ true
+
+
+ type
+ false
+ true
+
+
+ description
+ false
+ true
+
+
+ sortUrl
+ false
+ true
+
+
+ resultsPerPage
+ false
+ true
+
+
+ collectionLabel
+ false
+ true
+
+
+
+
+ listElement
+ blackboard.servlet.tags.ListElementTag
+ JSP
+
+ Creates a list item (one "cell" in a list)-- these items will be built up
+ into rows and rendered as a list (examples: First Name, Last Name, Email)
+ width - the optional width setting (used for the width of the column of the list)
+ label - the optional label for the column
+ href - the optional url to use to sort the list by
+ abbr - the abbreviation for screen readers (required for accessibility if a LABEL is supplied)
+ comparator - an optional attribute to specify a comparator used to sort the list.
+
+
+ width
+ false
+ true
+
+
+ label
+ false
+ true
+
+
+ href
+ false
+ true
+
+
+ abbr
+ false
+ true
+
+
+ comparator
+ false
+ true
+
+
+ name
+ false
+ true
+
+
+ nowrap
+ false
+ true
+
+
+ align
+ false
+ true
+
+
+ valign
+ false
+ true
+
+
+
+
+
+ simpleList
+ blackboard.servlet.tags.SimpleListTag
+ empty
+
+ Creates a list (UI determined by the TYPE attribute).
+ collection - the collection passed to the list
+ (usually a Blackboard filteredList resulting from a Load attempt
+ within the persistence layer. example: a list of users in a course)
+ type - the type of list (determines the UI)
+ description - description of the list (required for accessibility compliance)
+
+
+ collection
+ true
+ true
+
+
+ type
+ false
+ true
+
+
+ description
+ true
+ true
+
+
+
+
+
+ dateAvailability
+
+
+ blackboard.servlet.tags.DateAvailabilityTag
+
+ empty
+
+ creates the HTML and JavaScript for the date dropdown and
+ validation
+
+
+ TO CONNECT WITH FORM HANDLING:
+
+ Read from hidden elements:
+ data__course_contents___pk1_pk2__restrict_start_date
+ data__course_contents___pk1_pk2__restrict_end_date
+ On edit, write to tag Date startDate and Date endDate
+
+ NEW: can now rename these hidden fields with
+ startDateField
+ and
+ endDateField
+
+ For use with the blackboard.struts.DateAvailabilityForm, set
+ startDateField = "blackboard.struts.DateAvailabilityForm.startDateField";
+ endDateField = "blackboard.struts.DateAvailabilityForm.endDateField";
+
+ pickdate //unknown
+ pickname //unknown
+
+ make sure that you include a link to the javascript file "/javascript/validateForm.js"
+ in the jsp page when this widget is used, if you are not using the docTemplate or docTemplateHead
+ widgets. (this link has been removed
+ from the widget due to possible javascript conflicts)
+
+
+
+
+ formName
+
+ true
+
+ true
+
+
+
+ startCaption
+
+ false
+
+ true
+
+
+
+ endCaption
+
+ false
+
+ true
+
+
+
+ startDateField
+
+ false
+
+ true
+
+
+
+ endDateField
+
+ false
+
+ true
+
+
+
+ startDate
+
+ false
+
+ true
+
+
+
+ endDate
+
+ false
+
+ true
+
+
+
+
+
+ dateSelection
+ blackboard.servlet.tags.DateSelectionTag
+ empty
+
+ Creates the HTML for a date dropdown and related JavaScript validation
+
+ TO CONNECT WITH FORM HANDLING:
+ Read from hidden elements:
+ data__course_contents___pk1_pk2__restrict_start_date
+ On edit, write to tag Date startDate and Date endDate
+
+
+
+ formName
+ true
+ true
+
+
+
+ elementName
+ false
+ true
+
+
+
+ date
+ false
+ true
+
+
+
+
+ caretList
+ blackboard.servlet.tags.CaretListTag
+ JSP
+
+ Widget encapsulating a Caret List.
+ It works like the BreadcrumbBarTag, in that it can accept either
+ child tags (caret) or a collection of CaretBeans (blackboard.servlet.data.CaretBean).
+
+ description: the table summary (for accessibility/screenreader functionality), describes
+ the function of the caret list.
+
+
+
+ description
+ false
+ true
+
+
+ collection
+ false
+ true
+
+
+
+
+ caret
+ blackboard.servlet.tags.CaretTag
+ JSP
+
+ Entry in a Caret List. Contains a title, description, and href
+ (which is a link for the title attribute). Only the title is
+ required.
+ The description is set in the body of the tag
+
+
+ title
+ true
+ true
+
+
+ href
+ false
+ true
+
+
+
+
+ module
+ blackboard.servlet.tags.ModuleTag
+ JSP
+
+ Creates html for a module.
+
+
+ title
+ true
+ true
+
+
+ bgColor
+ false
+ true
+
+
+ borderColor
+ false
+ true
+
+
+ borderSize
+ false
+ true
+
+
+ titleBgColor
+ false
+ true
+
+
+ titleColor
+ false
+ true
+
+
+ layoutUIStyle
+ false
+ true
+
+
+
+
+
+ actionItem
+ blackboard.servlet.tags.ActionItemTag
+ Empty
+
+ Action items (such as Add Content), which appear in the
+ ActionBar
+
+
+ title
+ true
+ true
+
+
+ href
+ true
+ true
+
+
+ imgUrl
+ true
+ true
+
+
+
+
+ actionBar
+ blackboard.servlet.tags.ActionBarTag
+ JSP
+
+ Action items (such as Add Content) appear in the
+ ActionBar
+
+
+ action
+ false
+ true
+
+
+ icon
+ false
+ true
+
+
+ maxItems
+ false
+ true
+
+
+ collection
+ false
+ true
+
+
+
+
+ colorPicker
+ blackboard.servlet.tags.ColorPickerTag
+ empty
+
+ Creates an form element for choosing a color.
+
+ name - Name of the form element;
+ color - Current color;
+
+
+ name
+ true
+ true
+
+
+ color
+ false
+ true
+
+
+ formName
+ false
+ true
+
+
+
+
+ modulePersonalizationPage
+ blackboard.servlet.tags.ModulePersonalizationPageTag
+ JSP
+
+ Creates the header and footer for a module personalization page.
+
+
+ title
+ false
+ true
+
+
+ iconUrl
+ false
+ true
+
+
+
+
+ modulePersonalizationReceipt
+ blackboard.servlet.tags.ModulePersonalizationReceiptTag
+ JSP
+
+ Creates a module personalization receipt.
+
+
+ title
+ false
+ true
+
+
+ iconUrl
+ false
+ true
+
+
+ recallUrl
+ false
+ true
+
+
+
+
+ moduleAdminPage
+ blackboard.servlet.tags.ModuleAdminPageTag
+ JSP
+
+ Creates the header and footer for a module personalization page.
+
+
+ title
+ false
+ true
+
+
+ iconUrl
+ false
+ true
+
+
+
+
+ moduleAdminReceipt
+ blackboard.servlet.tags.ModuleAdminReceiptTag
+ JSP
+
+ Creates a module personalization receipt.
+
+
+ title
+ false
+ true
+
+
+ iconUrl
+ false
+ true
+
+
+ recallUrl
+ false
+ true
+
+
+
+
+
+
+ textbox
+ blackboard.servlet.tags.TextboxTag
+ empty
+
+ Creates a textbox tag with formatting and MathML controls.
+
+ isMathML - should the widget include the MathML links?
+ isFormattedText - should the widget include radio buttons for smart/plain/html?
+ mode - modify|insert
+ name - the name of the text area control, used in JS as well
+ label - label for textarea
+ rows - number of rows for textarea
+ cols - number of columns for textarea
+ minLength - validation-- must have a min length of this
+ maxLength - text content can be no longer than maxLength (validation
+ text - the text value of the area
+ xContent - the structured text, in xml
+ format - smarttext|plaintext|html
+ includeJs - should only be true ONCE on a page-- set for the first MathML element on page
+ popupType - defaults to html-- but can configure in future to popup.jsp instead
+
+
+
+
+ isMathML
+ false
+ true
+
+
+
+
+ isFormattedText
+ false
+ true
+
+
+
+ mode
+ false
+ true
+
+
+
+ name
+ true
+ true
+
+
+
+
+ label
+ false
+ true
+
+
+
+ rows
+ false
+ true
+
+
+
+
+ cols
+ false
+ true
+
+
+
+
+ minLength
+ false
+ true
+
+
+
+ maxLength
+ false
+ true
+
+
+
+
+ text
+ false
+ true
+
+
+
+
+ xContent
+ false
+ true
+
+
+
+
+ format
+ false
+ true
+
+
+
+
+ includeJs
+ false
+ true
+
+
+
+
+ popupType
+ false
+ true
+
+
+
+
+
+
+ toolbar
+ blackboard.servlet.tags.ToolbarTag
+ JSP
+ A generic toolbar
+
+ borderColor
+ false
+ true
+
+
+ toolbarColor
+ false
+ true
+
+
+ height
+ false
+ true
+
+
+ width
+ false
+ true
+
+
+ styleClass
+ false
+ true
+
+
+
+
+ toolbarButton
+ blackboard.servlet.tags.ToolbarButtonTag
+ JSP
+ Very similar to an ActionItem containing a link, label and icon
+
+ label
+ false
+ true
+
+
+ link
+ true
+ true
+
+
+ icon
+ false
+ true
+
+
+ iconAlternative
+ false
+ true
+
+
+ iconHeight
+ false
+ true
+
+
+ iconWidth
+ false
+ true
+
+
+
+
+ toolbarDivider
+ blackboard.servlet.tags.ToolbarDividerTag
+ JSP
+ A vertical divider element
+
+ height
+ false
+ true
+
+
+
+
+ toolbarEmpty
+ blackboard.servlet.tags.ToolbarEmptyTag
+ JSP
+ A completely empty element ... do with it what you will, but check the documentation for toolbar eccentricities
+
+
+
+ toolbarForm
+ blackboard.servlet.tags.ToolbarFormTag
+ JSP
+ Wrapper for toolbar form elements
+
+ name
+ false
+ true
+
+
+ action
+ true
+ true
+
+
+ method
+ false
+ true
+
+
+ encType
+ false
+ true
+
+
+
+
+ toolbarText
+ blackboard.servlet.tags.ToolbarTextTag
+ JSP
+ A text input form element
+
+ inputId
+ true
+ true
+
+
+ label
+ false
+ true
+
+
+ size
+ false
+ true
+
+
+ value
+ false
+ true
+
+
+ icon
+ false
+ true
+
+
+ iconAlternative
+ false
+ true
+
+
+ iconHeight
+ false
+ true
+
+
+ iconWidth
+ false
+ true
+
+
+
+
+ toolbarSelect
+ blackboard.servlet.tags.ToolbarSelectTag
+ JSP
+ Info.
+
+ inputId
+ true
+ true
+
+
+ label
+ false
+ true
+
+
+ icon
+ false
+ true
+
+
+ iconAlternative
+ false
+ true
+
+
+ iconHeight
+ false
+ true
+
+
+ iconWidth
+ false
+ true
+
+
+
+
+
+
+ navigationItemMenu
+ blackboard.servlet.tags.NavigationItemMenuTag
+ JSP
+
+ A box defined by a cascading style sheet, containing all the navigation items belonging to a
+ certain navigation family. Similar to a caret list, but designed for inline navigation links.
+
+
+ family
+ true
+ true
+
+
+ id
+ false
+ true
+
+
+ substitutionMap
+ false
+ true
+
+
+
+
+
+ box
+ blackboard.servlet.tags.BoxTag
+ JSP
+
+ A basic box. The body of the tag is included inside the box. Border color
+ and background color can be specified for visual interfaces.
+
+
+ borderColor
+ false
+ true
+
+
+ backgroundColor
+ false
+ true
+
+
+
+
+ search
+ blackboard.servlet.tags.SearchTag
+ JSP
+
+ A tabbed search interface. Wraps the UI html around whatever content is in the body of
+ the tag
+
+ Attributes:
+ isShowAdvanced - defaults to false. if true, displays a second tab, for Advanced search,
+ and adds hyperlink wrappers for the inactive tab (note: tabbing between the two
+ views, normal and advanced, is handled by the tab. If a searchUrl (below) is given,
+ the hyperlink for the tabs is created by appending "&mode=advanced|normal". Otherwise,
+ a URL is determined from the request.
+ searchUrl: an optional attribute used to construct the hyperlink for the Advanced|Normal
+ tabs. Default- constructed from the request.
+
+
+ isShowAdvanced
+ false
+ true
+
+
+ searchUrl
+ false
+ true
+
+
+
+
+
+ error
+ blackboard.servlet.tags.ErrorTag
+ empty
+
+ Handles exception UI
+
+ exception - the exception that was thrown
+
+
+ exception
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dateRangePicker
+
+
+ blackboard.servlet.tags.DatePickerTag
+
+ empty
+
+ creates the HTML and JavaScript for the date dropdown and
+ validation
+
+ Calendar startDate - if null, defaults to the current time
+ Calendar endDate - if null, end date dropdown is omitted
+
+ int datePickerIndex - defaults to 0, should be incremented for additional pickers on a page
+ (NOTE: datePicker and dateRangePicker use the same field naming convention, and should not have the same index if on a page together)
+
+ String formName - defaults to "forms[0]", should be replaced by the form name attribute if more than one form is used on the page
+ String startCaption - label to use for start date picker, defaults to "Start"
+ String endCaption - label to use for the end date picker, defaults to "End"
+ String endDateField - see below
+ String startDateField - see below
+
+
+ boolean checkPastDue - defaults to false, set to true if js validation for past due events is needed
+ boolean isEndChecked - defaults to false, set to true if the end date is set in the data object (as opposed to an as-yet-unset end date)
+
+
+ TO CONNECT WITH FORM HANDLING:
+ Hidden field names are set with
+ startDateField
+ and
+ endDateField
+ By default, read from hidden inputs:
+ start_date_0
+ end_date_0
+ (if manually setting these names, form name is rendered to page as:
+ startDateField+"_" + datePickerIndex, to allow multiple pickers per page)
+
+ make sure that you include a link to the javascript file "/javascript/validateForm.js"
+ in the jsp page when this widget is used, if you are not using the docTemplate or docTemplateHead
+ widgets. (this link has been removed
+ from the widget due to possible javascript conflicts)
+
+
+
+
+ formName
+
+ false
+
+ true
+
+
+
+
+ startCaption
+
+ false
+
+ true
+
+
+
+ endCaption
+
+ false
+
+ true
+
+
+
+ startDateField
+
+ false
+
+ true
+
+
+
+ endDateField
+
+ false
+
+ true
+
+
+
+ startDate
+
+ false
+
+ true
+
+
+
+ endDate
+
+ false
+
+ true
+
+
+
+ datePickerIndex
+
+ false
+
+ true
+
+
+
+
+ checkPastDue
+
+ false
+
+ true
+
+
+
+
+ isEndChecked
+
+ false
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+ datePicker
+
+
+ blackboard.servlet.tags.DatePickerTag
+
+ empty
+
+ creates the HTML and JavaScript for the date dropdown and
+ validation for a single date picker element
+
+ Calendar startDate - if null, defaults to the current time
+
+ int datePickerIndex - defaults to 0, should be incremented for additional pickers on a page
+ (NOTE: datePicker and dateRangePicker use the same field naming convention, and should not have the same index if on a page together)
+
+ String formName - defaults to "forms[0]", should be replaced by the form name attribute if more than one form is used on the page
+ String startCaption - label to use for start date picker, defaults to "Start"
+ String startDateField - see below
+
+
+ boolean checkPastDue - defaults to false, set to true if js validation for past due events is needed
+
+
+ TO CONNECT WITH FORM HANDLING:
+ Hidden field name is set with
+ startDateField
+ By default, read from hidden inputs:
+ start_date_0
+ (if manually setting these names, form name is rendered to page as:
+ startDateField+"_" + datePickerIndex, to allow multiple pickers per page)
+
+ make sure that you include a link to the javascript file "/javascript/validateForm.js"
+ in the jsp page when this widget is used, if you are not using the docTemplate or docTemplateHead
+ widgets. (this link has been removed
+ from the widget due to possible javascript conflicts)
+
+
+
+
+ formName
+
+ false
+
+ true
+
+
+
+
+ startCaption
+
+ false
+
+ true
+
+
+
+ startDateField
+
+ false
+
+ true
+
+
+
+ startDate
+
+ false
+
+ true
+
+
+
+ datePickerIndex
+
+ false
+
+ true
+
+
+
+
+ checkPastDue
+
+ false
+
+ true
+
+
+
+
+
+
+ errors
+ blackboard.servlet.tags.ErrorsTag
+ empty
+
+ This is a replacement for the Struts html:error tag, which does not
+ include the internationalization features. It is assumed that the object
+ specified by "name" is an ActionErrors object, and that for each
+ ActionError it contains, the "key" property is actually the literal
+ message that should be displayed, and not a key into some ResourceBundle.
+
+ Note that, due to a dependency on Struts, and the fact that Struts 1.0
+ cannot be loaded from the systemlib classloader, this class is NOT built
+ into the bb-taglib-api.jar. Instead, if you need to use this tag, you
+ must share the class into your webapp src directory. See tmoore for info.
+
+
+ name
+ false
+ true
+
+
+ property
+ false
+ true
+
+
+
+
+ ppgBase
+ blackboard.servlet.tags.PpgBaseTag
+ empty
+
+
+
+
Index: lams_bb_integration/WEB-INF/config/taglibs/bbUI.xsl
===================================================================
diff -u
--- lams_bb_integration/WEB-INF/config/taglibs/bbUI.xsl (revision 0)
+++ lams_bb_integration/WEB-INF/config/taglibs/bbUI.xsl (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
Body:
+
+
Info:
+
+ Attributes:
+
+
+
+ Required:
+ Real-time evaluated:
+
+
+
+
+
+
+
+
+
+
Index: lams_bb_integration/WEB-INF/lib/axis-ant.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/WEB-INF/lib/axis.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/WEB-INF/lib/commons-codec-1.3.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/WEB-INF/lib/commons-discovery-0.2.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/WEB-INF/lib/commons-logging-1.0.4.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/WEB-INF/lib/jaxrpc.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/WEB-INF/lib/log4j-1.2.8.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/WEB-INF/lib/saaj.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/WEB-INF/lib/wsdl4j-1.5.1.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/WEB-INF/web.xml
===================================================================
diff -u
--- lams_bb_integration/WEB-INF/web.xml (revision 0)
+++ lams_bb_integration/WEB-INF/web.xml (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+ UserDataServlet
+ org.lamsfoundation.ld.integration.blackboard.UserDataServlet
+
+
+ LamsActionRequestServlet
+ org.lamsfoundation.ld.integration.blackboard.LamsActionRequestServlet
+
+
+
+ LamsActionRequestServlet
+ /LamsActionRequest
+
+
+ UserDataServlet
+ /UserData
+
+
+
+
+ /bbUI
+ /WEB-INF/config/taglibs/bbUI.tld
+
+
+ /bbData
+ /WEB-INF/config/taglibs/bbData.tld
+
+
+
Index: lams_bb_integration/build.xml
===================================================================
diff -u
--- lams_bb_integration/build.xml (revision 0)
+++ lams_bb_integration/build.xml (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_bb_integration/lib/bb-cms-admin.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/lib/bb-platform.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/lib/bb-taglibs.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/lib/servlet-api.jar
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/Constants.java
===================================================================
diff -u
--- lams_bb_integration/src/org/lamsfoundation/ld/integration/Constants.java (revision 0)
+++ lams_bb_integration/src/org/lamsfoundation/ld/integration/Constants.java (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,60 @@
+/**
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ */
+package org.lamsfoundation.ld.integration;
+
+/**
+ * @author Anthony Xiao
+ */
+public class Constants {
+
+ public static final String PARAM_USER_ID = "uid";
+ public static final String PARAM_SERVER_ID = "sid";
+ public static final String PARAM_TIMESTAMP = "ts";
+ public static final String PARAM_HASH = "hash";
+ //public static final String PARAM_URL = "url";
+ public static final String PARAM_METHOD = "method";
+ public static final String PARAM_LEARNING_SESSION_ID = "lsid";
+ public static final String PARAM_LEARNING_DESIGN_ID = "ldid";
+ public static final String PARAM_COURSE_ID = "course_id";
+
+
+ public static final String SERVLET_LOGIN_REQUEST = "/lams/LoginRequest";
+ public static final String SERVLET_ACTION_REQUEST = "/LamsActionRequest";
+
+ public static final String URLDECODER_CODING = "US-ASCII";
+
+ public static final String METHOD_AUTHOR = "author";
+ public static final String METHOD_MONITOR = "monitor";
+ public static final String METHOD_LEARNER = "learner";
+
+ // Conf file constants
+ //public static final String CONF_SERVER_ADDRRESS = "lamstwo.serverAddr";
+ //public static final String CONF_SERVER_ID = "lamstwo.serverId";
+ //public static final String CONF_SERVER_KEY = "lamstwo.serverKey";
+ //public static final String CONF_REQUEST_SOURCE = "lamstwo.requestSrc";
+
+ // XML format constnats
+ public static final String ELEM_FOLDER = "Folder";
+ public static final String ELEM_LEARNING_DESIGN = "LearningDesign";
+ public static final String ATTR_NAME = "name";
+ public static final String ATTR_RESOURCE_ID = "resourceId";
+
+}
Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsActionRequestServlet.java
===================================================================
diff -u
--- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsActionRequestServlet.java (revision 0)
+++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsActionRequestServlet.java (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,140 @@
+/****************************************************************
+ * Copyright (C) 2007 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+package org.lamsfoundation.ld.integration.blackboard;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.lamsfoundation.ld.integration.Constants;
+import blackboard.persist.BbPersistenceManager;
+import blackboard.persist.Id;
+import blackboard.platform.BbServiceManager;
+import blackboard.data.course.Course;
+import blackboard.platform.context.ContextManager;
+import blackboard.platform.context.Context;
+import blackboard.platform.plugin.PlugInException;
+import blackboard.platform.plugin.PlugInUtil;
+import blackboard.platform.session.BbSession;
+import blackboard.platform.session.BbSessionManagerService;
+
+
+/**
+ * @author Luke Foxton
+ */
+public class LamsActionRequestServlet extends HttpServlet {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The doGet method of the servlet.
+ *
+ * This method is called by a when a GET request is performed
+ * There are three types of requests for LAMS AUTHOR, MONITOR and LEARNER
+ * Basically it creates the redirect URL strings and sends the redirect
+ *
+ * @param request the request sent by the client to the server
+ * @param response the response sent by the server to the client
+ */
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException{
+
+ //get request parameters
+ String p_method = request.getParameter(Constants.PARAM_METHOD);
+
+ //String p_learningSessionId = request.getParameter(Constants.PARAM_LEARNING_SESSION_ID);
+ //String p_learningDesignId = request.getParameter(Constants.PARAM_LEARNING_DESIGN_ID);
+ String p_courseId = request.getParameter(Constants.PARAM_COURSE_ID);
+
+ //validate method parameter and associated parameters
+ if(p_method == null)
+ {
+ throw new ServletException("requred parameters missing");
+ }
+
+
+ ContextManager ctxMgr = null;
+ Context ctx = null;
+
+ try{
+ // get Blackboard context
+ ctxMgr = (ContextManager) BbServiceManager.lookupService(ContextManager.class);
+ ctx = ctxMgr.setContext(request);
+
+
+ // get the session object to obtain the current user and course object
+ BbSessionManagerService sessionService = BbServiceManager.getSessionManagerService();
+ BbSession bbSession = sessionService.getSession( request );
+ String username = bbSession.getUserName();
+
+ //attach the learningSessionId, learningDesignId or courseId to the redirect url
+ //String redirect = LamsSecurityUtil.generateRequestURL(username, p_method);
+ String redirect = LamsSecurityUtil.generateRequestURL(ctx, p_method);
+
+ //redirect = LamsSecurityUtil.generateRequestURL(username, p_method);
+ /*if(p_learningSessionId!=null)
+ {
+ redirect += '&' + Constants.PARAM_LEARNING_SESSION_ID + '=' + p_learningSessionId;
+ //redirect1 += '&' + Constants.PARAM_LEARNING_SESSION_ID + '=' + p_learningSessionId;
+ }
+ if(p_learningDesignId!=null)
+ {
+ redirect += '&' + Constants.PARAM_LEARNING_DESIGN_ID + '=' + p_learningDesignId;
+ //redirect1 += '&' + Constants.PARAM_LEARNING_SESSION_ID + '=' + p_learningSessionId;
+ }
+ if(p_courseId!=null)
+ {
+ redirect += '&' + Constants.PARAM_COURSE_ID + '=' + p_courseId;
+ //redirect1 += '&' + Constants.PARAM_LEARNING_SESSION_ID + '=' + p_learningSessionId;
+ }
+ */
+
+
+ if(p_courseId!=null)
+ {
+ redirect += '&' + Constants.PARAM_COURSE_ID + '=' + p_courseId;
+ //redirect1 += '&' + Constants.PARAM_LEARNING_SESSION_ID + '=' + p_learningSessionId;
+ }
+
+ //response.sendRedirect(redirect1);
+
+ response.sendRedirect(response.encodeRedirectURL(redirect));
+
+
+ } catch (Exception e){
+
+ throw new ServletException(e.getMessage(), e);
+ }
+ finally{
+ //make sure context is released
+ if (ctxMgr != null)
+ ctxMgr.releaseContext();
+ }
+ }
+}
Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsPluginUtil.java
===================================================================
diff -u
--- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsPluginUtil.java (revision 0)
+++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsPluginUtil.java (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,141 @@
+/****************************************************************
+ * Copyright (C) 2007 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+package org.lamsfoundation.ld.integration.blackboard;
+
+
+import java.util.Properties;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import blackboard.platform.plugin.PlugInException;
+import blackboard.platform.plugin.PlugInUtil;
+
+
+
+/**
+ *
+ * This class basically manages the lams.properties file on the BB server
+ * This file contains the LAMS server URL, server ID and secret key
+ * These values allow the communication between the two servers
+ *
+ * @author Luke Foxton
+ */
+public class LamsPluginUtil {
+
+ public static final String VENDOR_ID = "lams";
+ public static final String PLUGIN_HANDLE = "plglamscontent";
+ public static final String CONTENT_HANDLE = "resource/x-lams-lamscontent";
+ public static final String FILE_PROPERTIES = "lams.properties";
+
+ public static final String PROP_LAMS_SECRET_KEY = "LAMS_SERVER_SKEY";
+ public static final String PROP_LAMS_SERVER_ID = "LAMS_SERVER_ID";
+ public static final String PROP_LAMS_URL = "LAMS_SERVER_URL";
+ public static final String PROP_REQ_SRC = "BB_REQ_SRC";
+
+ private static Properties lamsProperties = null;
+
+
+ /**
+ * Returns the properties file that contains the server name, key and connection URL
+ *
+ * @return The LAMS Properties file
+ * @throws PlugInException
+ * @throws FileNotFoundException
+ * @throws IOException
+ */
+ public static Properties getProperties() {
+ if(lamsProperties != null)
+ return lamsProperties;
+
+ //load LAMS Configuration File
+ try{
+ File configFile = new File(PlugInUtil.getConfigDirectory(VENDOR_ID, PLUGIN_HANDLE).getPath() + File.separator + FILE_PROPERTIES);
+ Properties p = new Properties();
+
+ if(configFile.exists())
+ p.load(new FileInputStream(configFile));
+ else{
+ p.setProperty(PROP_LAMS_URL, "");
+ p.setProperty(PROP_LAMS_SECRET_KEY, "");
+ p.setProperty(PROP_LAMS_SERVER_ID, "");
+ p.setProperty(PROP_REQ_SRC, "");
+ }
+
+ lamsProperties = p;
+ return p;
+ } catch(PlugInException e){
+ throw new RuntimeException(e);
+ } catch(FileNotFoundException e){
+ throw new RuntimeException(e);
+ } catch(IOException e){
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Save a Properties file as the LAMS properties file
+ *
+ * @param p
+ * @throws PlugInException
+ * @throws FileNotFoundException
+ * @throws IOException
+ */
+ public static void setProperties(Properties p) {
+ try{
+ lamsProperties = p;
+
+ FileOutputStream configFile =
+ new FileOutputStream(PlugInUtil.getConfigDirectory(VENDOR_ID, PLUGIN_HANDLE).getPath() +
+ File.separator + FILE_PROPERTIES);
+ p.store(configFile, "LAMS configuration");
+ configFile.close();
+ } catch(PlugInException e){
+ throw new RuntimeException(e);
+ } catch(FileNotFoundException e){
+ throw new RuntimeException(e);
+ } catch(IOException e){
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static String getSecretKey(){
+ return getProperties().getProperty(PROP_LAMS_SECRET_KEY);
+ }
+
+ public static String getServerUrl(){
+ return getProperties().getProperty(PROP_LAMS_URL);
+ }
+
+ public static String getServerId(){
+ return getProperties().getProperty(PROP_LAMS_SERVER_ID);
+ }
+
+ public static String getReqSrc(){
+ return getProperties().getProperty(PROP_REQ_SRC);
+ }
+
+
+}
Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsSecurityUtil.java
===================================================================
diff -u
--- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsSecurityUtil.java (revision 0)
+++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsSecurityUtil.java (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,437 @@
+/****************************************************************
+ * Copyright (C) 2007 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+package org.lamsfoundation.ld.integration.blackboard;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.rmi.RemoteException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Date;
+import java.util.Locale;
+import javax.xml.rpc.ServiceException;
+import blackboard.platform.context.ContextManager;
+import blackboard.platform.context.Context;
+import org.apache.commons.codec.binary.Hex;
+import org.lamsfoundation.lams.integrations.sakai.logic.impl.LamstwoUtils;
+import org.lamsfoundation.lams.webservice.LessonManager;
+import org.lamsfoundation.lams.webservice.LessonManagerService;
+import org.lamsfoundation.lams.webservice.LessonManagerServiceLocator;
+import org.lamsfoundation.ld.integration.Constants;
+import org.lamsfoundation.ld.webservice.*;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+import org.apache.log4j.Logger;
+import java.io.*;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+/**
+ * @author Luke Foxton
+ */
+public class LamsSecurityUtil {
+
+ //private static Connection _conn = null;
+ static Logger logger = Logger.getLogger(LamsSecurityUtil.class);
+
+ public static String generateRequestURL(Context ctx, String method) throws Exception
+ {
+ String serverAddr = getServerAddress();
+ String serverId = getServerID();
+ String reqSrc = getReqSrc();
+
+ // If lams.properties could not be read, throw exception
+ if(serverAddr == null || serverId == null || reqSrc==null){
+ throw new Exception("Configuration Exception " + serverAddr + ", " + serverId);
+ }
+
+ String timestamp = new Long(System.currentTimeMillis()).toString();
+ String username = ctx.getUser().getUserName();
+ String hash = generateAuthenticationHash(timestamp, username, method, serverId);
+ String courseId = ctx.getCourse().getCourseId();
+ String country = "US";
+ String lang = "en";
+
+
+ //ResourceLoader rl = new ResourceLoader();
+ //String[] locale = ctx.getGuestSessionLocale().split("-");
+
+ //String siteID = getCurrentContext();
+
+ // TODO: Make locale settings work
+
+ String url;
+ try {
+ url = serverAddr + "/LoginRequest?"
+ + "&uid=" + URLEncoder.encode(username, "UTF8")
+ + "&method=" + method
+ + "&ts=" + timestamp
+ + "&sid=" + serverId
+ + "&hash=" + hash
+ + "&courseid=" + URLEncoder.encode(courseId, "UTF8")
+ + "&country=" + country
+ + "&lang=" + lang
+ + "&requestSrc=" + URLEncoder.encode(reqSrc, "UTF8");
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException();
+ }
+
+ System.out.println(url);
+
+ return url;
+ }
+
+ public static String getLearningDesigns(Context ctx, Integer mode) throws Exception
+ {
+ String serverAddr = getServerAddress();
+ String serverId = getServerID();
+ String serverKey = getServerKey();
+
+ // If lams.properties could not be read, throw exception
+ if(serverAddr == null || serverId == null || serverKey==null){
+ throw new Exception("Configuration Exception " + serverAddr + ", " + serverId);
+ }
+
+ String timestamp = new Long(System.currentTimeMillis()).toString();
+ String username = ctx.getUser().getUserName();
+ String hash = generateAuthenticationHash(timestamp, username, serverId);
+ String courseId = ctx.getCourse().getCourseId();
+ String country = "US";
+ String lang = "en";
+
+ // TODO: Make locale settings work
+ String learningDesigns = "[]"; // empty javascript array
+ try {
+ String serviceURL = serverAddr + "/services/xml/LearningDesignRepository?"
+ + "datetime=" + timestamp
+ + "&username=" + URLEncoder.encode(username, "utf8")
+ + "&serverId=" + URLEncoder.encode(serverId, "utf8")
+ + "&serverKey=" + URLEncoder.encode(serverKey, "utf8")
+ + "&hashValue=" + hash
+ + "&courseId=" + URLEncoder.encode(courseId, "UTF8")
+ + "&country=" + country
+ + "&lang=" + lang
+ + "&mode=" + mode;
+
+ URL url = new URL(serviceURL);
+ URLConnection conn = url.openConnection();
+ if (!(conn instanceof HttpURLConnection)) {
+ logger.error("Unable to open connection to: " + serviceURL);
+ }
+
+ HttpURLConnection httpConn = (HttpURLConnection)conn;
+
+ if (httpConn.getResponseCode() != HttpURLConnection.HTTP_OK) {
+ logger.error("HTTP Response Code: " + httpConn.getResponseCode()
+ + ", HTTP Response Message: " + httpConn.getResponseMessage());
+ }
+
+ InputStream is = url.openConnection().getInputStream();
+
+ // parse xml response
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ Document document = db.parse(is);
+
+ learningDesigns = "[" + convertToTigraFormat(document.getDocumentElement()) + "]";
+
+ // replace sequence id with javascript method
+ String pattern = "'(\\d+)'";
+ String replacement = "'javascript:selectSequence($1)'";
+ learningDesigns = learningDesigns.replaceAll(pattern, replacement);
+
+ // TODO better error handling
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ } catch (SAXException e) {
+ e.printStackTrace();
+ }
+
+ return learningDesigns;
+ }
+
+
+
+ /*
+ * TODO:
+ */
+ public static Long scheduleLesson(Context ctx, long ldId, String title, String desc, String startDate) {
+
+
+ String serverID = getServerID();
+ String serverAddress = getServerAddress();
+ String serverKey = getServerKey();
+
+ String username = ctx.getUser().getUserName();
+ String siteId = getReqSrc();
+
+ if (serverID == null || serverAddress == null || serverKey == null ) {
+ logger.error("Unable to retrieve learning designs from LAMS, one or more lams configuration properties is null");
+ return null;
+ }
+
+ try {
+
+ String datetime = new Date().toString();
+ String hashValue = LamstwoUtils.generateAuthenticationHash(serverID, serverKey, username, datetime);
+
+ LessonManagerService service = new LessonManagerServiceLocator();
+ LessonManager lessonManager = service.getLessonManagerService(new URL(serverAddress + "/services/LessonManagerService"));
+ Long lessonId = lessonManager.scheduleLesson(serverID, datetime, hashValue, username, ldId, siteId, title, desc, startDate, "US", "en");
+
+ return lessonId;
+
+ } catch (MalformedURLException e) {
+ logger.error("Unable to schedule LAMS lesson, bad URL: '"
+ + serverAddress
+ + "', please check sakai.properties");
+ } catch (ServiceException e) {
+ logger.error("Unable to schedule LAMS lesson, RPC Service Exception");
+ e.printStackTrace();
+ } catch (RemoteException e) {
+ logger.error("Unable to schedule LAMS lesson, RMI Remote Exception");
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static Long startLesson(Context ctx, long ldId, String title, String desc) {
+
+ String serverID = getServerID();
+ String serverAddress = getServerAddress();
+ String serverKey = getServerKey();
+
+ String username = ctx.getUser().getUserName();
+ String siteId = getReqSrc();
+
+ if (serverID == null || serverAddress == null || serverKey == null ) {
+ logger.error("Unable to retrieve learning designs from LAMS, one or more lams configuration properties is null");
+ return null;
+ }
+
+ try {
+
+ String datetime = new Date().toString();
+ String hashValue = LamstwoUtils.generateAuthenticationHash(serverID, serverKey, username, datetime);
+
+ LessonManagerService service = new LessonManagerServiceLocator();
+ LessonManager lessonManager = service.getLessonManagerService(new URL(serverAddress + "/services/LessonManagerService"));
+ Long lessonId = lessonManager.startLesson(serverID, datetime, hashValue, username, ldId, siteId, title, desc, "en", "US");
+
+ return lessonId;
+
+ } catch (MalformedURLException e) {
+ logger.error("Unable to start LAMS lesson, bad URL: '"
+ + serverAddress
+ + "', please check sakai.properties");
+ } catch (ServiceException e) {
+ logger.error("Unable to start LAMS lesson, RPC Service Exception");
+ e.printStackTrace();
+ } catch (RemoteException e) {
+ logger.error("Unable to start LAMS lesson, RMI Remote Exception");
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ /*
+ * TODO:
+ */
+ public static boolean deleteLesson(Context ctx, long lsId) {
+ String serverID = getServerID();
+ String serverAddress = getServerAddress();
+ String serverKey = getServerKey();
+
+ String username = ctx.getUser().getUserName();
+
+
+ if (serverID == null || serverAddress == null || serverKey == null ) {
+ logger.error("Unable to delete LAMS lesson: lsid = " + lsId + ", one or more lams configuration properties is null");
+ return false;
+ }
+
+ try {
+ String datetime = new Date().toString();
+ String hashValue = LamstwoUtils.generateAuthenticationHash(serverID, serverKey, username, datetime);
+ LessonManagerService service = new LessonManagerServiceLocator();
+ LessonManager lessonManager = service.getLessonManagerService(new URL(serverAddress + "/services/LessonManagerService"));
+ lessonManager.deleteLesson(serverID, datetime, hashValue, username, lsId);
+
+ return true;
+
+ } catch (MalformedURLException e) {
+ logger.error("Unable to delete LAMS lesson, lsid = " + lsId + ": ', bad URL: '"
+ + serverAddress
+ + "', please check sakai.properties");
+ } catch (ServiceException e) {
+ logger.error("Unable to start LAMS lesson, RPC Service Exception");
+ e.printStackTrace();
+ } catch (RemoteException e) {
+ logger.error("Unable to start LAMS lesson, RMI Remote Exception");
+ e.printStackTrace();
+ }
+ return false;
+ }
+
+
+ public static String getServerAddress()
+ {
+ return LamsPluginUtil.getProperties().getProperty(LamsPluginUtil.PROP_LAMS_URL);
+ }
+
+ public static String getServerID()
+ {
+ return LamsPluginUtil.getProperties().getProperty(LamsPluginUtil.PROP_LAMS_SERVER_ID);
+ }
+
+ public static String getServerKey()
+ {
+ return LamsPluginUtil.getProperties().getProperty(LamsPluginUtil.PROP_LAMS_SECRET_KEY);
+ }
+
+ public static String getReqSrc()
+ {
+ return LamsPluginUtil.getProperties().getProperty(LamsPluginUtil.PROP_REQ_SRC);
+ }
+
+
+
+
+ public static String convertToTigraFormat(Node node) {
+
+ StringBuilder sb = new StringBuilder();
+
+ if (node.getNodeName().equals(Constants.ELEM_FOLDER)) {
+ sb.append("['");
+ sb.append(
+ node.getAttributes().getNamedItem(
+ Constants.ATTR_NAME).getNodeValue()).append(
+ "',").append("null").append(',');
+
+ NodeList children = node.getChildNodes();
+ if (children.getLength() == 0) {
+ sb.append("['',null]");
+ } else {
+ sb.append(convertToTigraFormat(children.item(0)));
+ for (int i = 1; i < children.getLength(); i++) {
+ sb.append(',').append(
+ convertToTigraFormat(children.item(i)));
+ }
+ }
+ sb.append(']');
+ } else if (node.getNodeName().equals(
+ Constants.ELEM_LEARNING_DESIGN)) {
+ sb.append('[');
+ sb.append('\'').append(
+ node.getAttributes().getNamedItem(
+ Constants.ATTR_NAME).getNodeValue()).append(
+ '\'').append(',').append('\'').append(
+ node.getAttributes().getNamedItem(
+ Constants.ATTR_RESOURCE_ID).getNodeValue())
+ .append('\'');
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ //generate authentication hash code to validate parameters
+ public static String generateAuthenticationHash(String datetime, String login, String method, String serverId) {
+ String secretkey = LamsPluginUtil.getSecretKey();
+
+ String plaintext = datetime.toLowerCase().trim() +
+ login.toLowerCase().trim() +
+ method.toLowerCase().trim() +
+ serverId.toLowerCase().trim() +
+ secretkey.toLowerCase().trim();
+
+ System.out.println(plaintext);
+ String hash = sha1(plaintext);
+
+ return hash;
+ }
+
+
+ //generate authentication hash code to validate parameters
+ public static String generateAuthenticationHash(String datetime, String login, String serverId) {
+ String secretkey = getServerKey();
+
+ String plaintext = datetime.toLowerCase().trim() +
+ login.toLowerCase().trim() +
+ serverId.toLowerCase().trim() +
+ secretkey;
+
+ System.out.println(plaintext);
+ String hash = sha1(plaintext);
+
+ return hash;
+ }
+
+ //generate authentication hash code to validate parameters
+ public static String generateAuthenticationHash(String datetime, String serverId)
+ throws NoSuchAlgorithmException {
+ String secretkey = LamsPluginUtil.getSecretKey();
+
+ String plaintext = datetime.toLowerCase().trim() +
+ serverId.toLowerCase().trim() +
+ secretkey.toLowerCase().trim() ;
+
+ return sha1(plaintext);
+ }
+
+
+ /**
+ * The parameters are:
+ * uid - the username on the external system
+ * method - either author, monitor or learner
+ * ts - timestamp
+ * sid - serverID
+ * str is [ts + uid + method + serverID + serverKey] (Note: all lower case)
+ *
+ * @param str The string to be hashed
+ * @return The hased string
+ */
+ private static String sha1(String str){
+ try{
+ MessageDigest md = MessageDigest.getInstance("SHA1");
+ return new String(Hex.encodeHex(md.digest(str.getBytes())));
+ } catch(NoSuchAlgorithmException e){
+ throw new RuntimeException(e);
+ }
+ }
+}
Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsServiceUtil.java
===================================================================
diff -u
--- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsServiceUtil.java (revision 0)
+++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/LamsServiceUtil.java (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,114 @@
+/**
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ */
+package org.lamsfoundation.ld.integration.blackboard;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.rmi.RemoteException;
+import java.security.NoSuchAlgorithmException;
+import java.util.Date;
+import javax.xml.rpc.ServiceException;
+import lamsws.LDRepository;
+import lamsws.LDRepositoryServiceLocator;
+import lamsws.LearningSessionManager;
+import lamsws.LearningSessionManagerServiceLocator;
+import lamsws.SimpleLearningDesignVO;
+import lamsws.UserManager;
+import lamsws.UserManagerServiceLocator;
+import org.lamsfoundation.ld.integration.Constants;
+import blackboard.platform.plugin.PlugInException;
+
+/**
+ * @author Luke Foxton
+ */
+public class LamsServiceUtil {
+ public static final String FILE_WS_PATH = "/lams/services/";
+ private static final String WS_LEARNING_DESIGN = "LearningDesignService";
+ private static final String WS_LEARNING_SESSION = "LearningSessionService";
+
+
+ public static SimpleLearningDesignVO[] getAllLearningDesign(String login)
+ throws RemoteException, ServiceException
+ {
+
+ LDRepository ldr = getLearningDesignRepository();
+
+ String timestamp = Long.toString(new Date().getTime());
+
+ String serverId = LamsPluginUtil.getProperties().getProperty(LamsPluginUtil.PROP_LAMS_SERVER_ID);
+ String hash = LamsSecurityUtil.generateAuthenticationHash(timestamp, login, serverId);
+
+ SimpleLearningDesignVO[] res = null;
+
+ res = ldr.getAllLearningDesigns(serverId, timestamp, hash, login);
+
+ return res;
+ }
+
+ public static long createLearningSession(String login, long ldId, String courseId, String title, String desc) throws RemoteException, ServiceException
+ {
+ LearningSessionManager lsmanager = getLearningSessionManager();
+
+ String timestamp = Long.toString(new Date().getTime());
+ String serverId = LamsPluginUtil.getProperties().getProperty(LamsPluginUtil.PROP_LAMS_SERVER_ID);
+ String hash = LamsSecurityUtil.generateAuthenticationHash(timestamp, login, serverId);
+
+ long learningSessionId = lsmanager.createLearningSession(serverId, timestamp, hash, login, ldId, courseId, title, desc, LearningSessionManager.NORMAL);
+ return learningSessionId;
+ }
+
+
+
+
+ private static LearningSessionManager getLearningSessionManager() throws RemoteException, ServiceException{
+ //get lamsServerUrl
+ String lamsServerUrl = LamsPluginUtil.getServerUrl();
+
+ //call the wsdl generated stubs
+ LearningSessionManagerServiceLocator lssService = new LearningSessionManagerServiceLocator();
+ LearningSessionManager lsm = null;
+
+ String serviceUrl = lamsServerUrl + FILE_WS_PATH + WS_LEARNING_SESSION;
+
+ lssService.setEndpointAddress(WS_LEARNING_SESSION, serviceUrl);
+ lsm = lssService.getLearningSessionService();
+
+ return lsm;
+ }
+
+
+ private static LDRepository getLearningDesignRepository() throws RemoteException, ServiceException{
+ //get lamsServerUrl
+ String lamsServerUrl = LamsPluginUtil.getServerUrl();
+
+ //call the wsdl generated stubs
+ LDRepositoryServiceLocator ldrService = new LDRepositoryServiceLocator();
+ LDRepository ldr = null;
+
+ String serviceUrl = lamsServerUrl + FILE_WS_PATH + WS_LEARNING_DESIGN;
+ System.out.println("trace: " + serviceUrl);
+
+ ldrService.setEndpointAddress(WS_LEARNING_DESIGN, serviceUrl);
+ ldr = ldrService.getLearningDesignService();
+
+ return ldr;
+ }
+}
Index: lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/UserDataServlet.java
===================================================================
diff -u
--- lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/UserDataServlet.java (revision 0)
+++ lams_bb_integration/src/org/lamsfoundation/ld/integration/blackboard/UserDataServlet.java (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,203 @@
+/**
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ */
+package org.lamsfoundation.ld.integration.blackboard;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Date;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+//import javax.servlet.ServletException;
+
+import org.apache.commons.codec.binary.Hex;
+//import org.lamsfoundation.lams.integration.security.RandomPasswordGenerator;
+//import org.lamsfoundation.lams.usermanagement.AuthenticationMethod;
+//import org.lamsfoundation.lams.util.HashUtil;
+import org.lamsfoundation.ld.util.CSVUtil;
+import org.lamsfoundation.ld.integration.Constants;
+
+import blackboard.persist.BbPersistenceManager;
+import blackboard.persist.user.UserDbLoader;
+import blackboard.platform.BbServiceManager;
+import blackboard.data.user.User;
+import blackboard.platform.context.ContextManager;
+import blackboard.platform.context.Context;
+import org.apache.log4j.Logger;
+
+
+/**
+ * @author Anthony Xiao
+ */
+public class UserDataServlet extends HttpServlet {
+
+ static Logger logger = Logger.getLogger(UserDataServlet.class);
+
+ /**
+ * The doGet method of the servlet.
+ *
+ * This method is called when a form has its tag value method equals to get.
+ *
+ * @param request the request send by the client to the server
+ * @param response the response send by the server to the client
+ * @throws ServletException if an error occurred
+ * @throws IOException if an error occurred
+ */
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException{
+
+ ContextManager ctxMgr = null;
+ Context ctx = null;
+ //get Blackboard context
+ try{
+ ctxMgr = (ContextManager) BbServiceManager.lookupService(ContextManager.class);
+ ctx = ctxMgr.setContext(request);
+
+
+ //get Parameter values
+ String usernameParam = request.getParameter(Constants.PARAM_USER_ID);
+ String tsParam = request.getParameter(Constants.PARAM_TIMESTAMP);
+ String hashParam = request.getParameter(Constants.PARAM_HASH);
+
+ //check paramaeters
+ if(usernameParam == null || tsParam == null || hashParam == null){
+ response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "missing expected parameters");
+ return;
+ }
+
+ String secretKey = LamsPluginUtil.getSecretKey();
+ String serverId = LamsPluginUtil.getServerId();
+
+ if(!sha1(tsParam+ usernameParam + serverId + secretKey).equals(hashParam)){
+ response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "authentication failed");
+ }
+
+ //get the persistence manager
+ BbPersistenceManager bbPm = BbServiceManager.getPersistenceService().getDbPersistenceManager();
+
+
+
+ //get user list, but no role info since there are no course info
+ UserDbLoader userLoader = (UserDbLoader) bbPm.getLoader(UserDbLoader.TYPE);
+ User u = userLoader.loadByUserName(usernameParam);
+
+ if(u==null){
+ throw new ServletException("user not found");
+ }
+
+
+
+ //construct the address
+ String address = u.getStreet1() + (u.getStreet1().length()==0?"":" ");
+ address+= u.getStreet2() + (address.length()==0?"":" ");
+ address+= u.getState() + (address.length()==0?"":" ");
+ address+= u.getCountry() + (address.length()==0?"":" ");
+ address+= u.getZipCode();
+ //String username = u.getUserName().replaceAll();
+
+
+ PrintWriter out = response.getWriter();
+
+ String loc_lang="en";
+ String loc_cntry="US";
+
+ /*
+ String locale = u.getLocale();
+ String loc_lang;
+ String loc_cntry;
+ if (u.getLocale()==null)
+ {
+ loc_lang="en";
+ loc_cntry="US";
+ }
+ else
+ {
+ String [] loc = locale.split("_");
+ loc_lang=loc[0];
+ loc_cntry=loc[1];
+ }
+ */
+
+ // The CSV list should be the format below
+ //
,,,,,,
+ // ,,,,
+ // ,,,
+ String[] valList = {
+ u.getTitle(),
+ u.getGivenName(),
+ u.getFamilyName(),
+ u.getStreet1()+u.getStreet2(),
+ u.getCity(),
+ u.getState(),
+ u.getZipCode(),
+ u.getCountry(),
+ u.getHomePhone1(),
+ u.getMobilePhone(),
+ u.getBusinessFax(),
+ u.getEmailAddress(),
+ loc_lang,
+ loc_cntry
+ };
+ // DEBUGGING
+ System.out.println(valList[0]);
+ System.out.println(valList[1]);
+ System.out.println(valList[2]);
+ System.out.println(valList[3]);
+ System.out.println(valList[4]);
+ System.out.println(valList[5]);
+ System.out.println(valList[6]);
+ System.out.println(valList[7]);
+ System.out.println(valList[8]);
+ System.out.println(valList[9]);
+ System.out.println(valList[10]);
+ System.out.println(valList[11]);
+ System.out.println(valList[12]);
+ System.out.println(valList[13]);
+ System.out.println("LUKE IS AWESOME: " + CSVUtil.write(valList));
+
+
+ out.println(CSVUtil.write(valList));
+
+ } catch (Exception e){
+ e.printStackTrace();
+ logger.error("Problem with user data servlet: " + e.getMessage(), e);
+ logger.error(e.getStackTrace().toString());
+ throw new ServletException("Failed to fetch user", e);
+ } finally{
+ //make sure context is released
+ if (ctxMgr != null)
+ ctxMgr.releaseContext();
+ }
+ }
+
+ private String sha1(String str){
+ try{
+ MessageDigest md = MessageDigest.getInstance("SHA1");
+ return new String(Hex.encodeHex(md.digest(str.getBytes())));
+ } catch(NoSuchAlgorithmException e){
+ throw new RuntimeException(e);
+ }
+ }
+}
Index: lams_bb_integration/src/org/lamsfoundation/ld/util/CSVUtil.java
===================================================================
diff -u
--- lams_bb_integration/src/org/lamsfoundation/ld/util/CSVUtil.java (revision 0)
+++ lams_bb_integration/src/org/lamsfoundation/ld/util/CSVUtil.java (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,170 @@
+/**
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ */
+
+package org.lamsfoundation.ld.util;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.regex.*;
+
+/**
+ * CSVUtil Provides "Comma Seperated Value" writing and parsing.
+ * The two methods write() and parse() will perform writing to and parse from
+ * the CSV format
+ *
+ * @author Anthony Xiao
+ */
+public class CSVUtil {
+
+ private static final char QUOTE = '"';
+ private static final char COMMA = ',';
+
+ /* precompile the patterns to speed up the search */
+
+ // should we put quotes around a value?
+ private static final Pattern CONTAINS_NEWLINE = Pattern.compile(".*(\\n|\\r)+.*");
+
+ // should we put quotes around a value?
+ private static final Pattern CONTAINS_COMMA = Pattern.compile(".*(,)+.*");
+
+ // should we escape the quotes?
+ private static final Pattern CONTAINS_QUOTE = Pattern.compile("\"");
+
+ // how should we wrap qoutes around comma or newline?
+ private static final String WRAP_QOUTE = "\"$0\"";
+
+ // how should we escape the value if it has qoutes?
+ private static final String ESCAPE_QUOTE = "\"\"";
+
+ // has this value been wrapped with quotes
+ private static final Pattern WRAPPED_QUOTE = Pattern.compile("^\"(.*((,|\\n|\\r)+).*)\"$");
+
+ // has this value been escaped by ESCAPE_QUOTE
+ private static final Pattern ESCAPED_QUOTE = Pattern.compile("\"\"");
+
+ // how should we unescape the the ESCAPED_QUOTE?
+ private static final String UNWRAP_QOUTE = "$1";
+
+ // how should we unescape the the ESCAPED_COMMA?
+ private static final String UNESCAPE_QUOTE = "\"";
+
+ /*
+ * NOTE: why are we using \\n|\\r in CONTAINS_NEWLINE and WRAPPED_QUOTE?
+ * javadoc says "." represents "Any character (may or may not match line terminators)"
+ * and we want to make sure terminiators such as newline (\n) gets matched as well
+ * if we dont match it then ,\n, will get written as ","\n","
+ */
+
+ /**
+ * Writes a array of String into CSV format
+ * @param vals - The array of string to be written into CSV format
+ * @return
+ */
+ public static String write(String[] vals){
+ String str = "";
+ int lastIndex = vals.length - 1;
+ for(int i=0; i
+
+<%@ taglib uri="/bbUI" prefix="bbUI"%>
+<%@ taglib uri="/bbData" prefix="bbData"%>
+
+
+<%
+ // SECURITY!
+ AccessManagerService accessManager = (AccessManagerService) BbServiceManager.lookupService(AccessManagerService.class);
+ if (!PlugInUtil.authorizeForSystemAdmin(request,response)){
+ accessManager.sendAccessDeniedRedirect(request,response);
+ return;
+ }
+
+ Properties p = LamsPluginUtil.getProperties();
+ String lamsServerUrl = p.getProperty("LAMS_SERVER_URL", "http://");
+ String lamsServerId = p.getProperty("LAMS_SERVER_ID", "");
+ String SecretKey = p.getProperty("LAMS_SERVER_SKEY", "");
+ String ReqSrc = p.getProperty("BB_REQ_SRC");
+%>
+
+
+
+ LAMS Configuration
+
+Configure Sample Plugin.
+
+
+
+
\ No newline at end of file
Index: lams_bb_integration/web/admin/config_proc.jsp
===================================================================
diff -u
--- lams_bb_integration/web/admin/config_proc.jsp (revision 0)
+++ lams_bb_integration/web/admin/config_proc.jsp (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,50 @@
+<%@page import="java.util.Properties,
+ blackboard.platform.BbServiceManager,
+ blackboard.platform.plugin.PlugInUtil,
+ blackboard.platform.security.AccessManagerService,
+ org.lamsfoundation.ld.integration.blackboard.LamsPluginUtil"
+
+ errorPage="/error.jsp"
+%>
+
+<%@ taglib uri="/bbUI" prefix="bbUI"%>
+<%@ taglib uri="/bbData" prefix="bbData"%>
+
+<%
+ // SECURITY!
+ AccessManagerService accessManager = (AccessManagerService) BbServiceManager.lookupService(AccessManagerService.class);
+ if (!PlugInUtil.authorizeForSystemAdmin(request,response)){
+ accessManager.sendAccessDeniedRedirect(request,response);
+ return;
+ }
+ Properties p = LamsPluginUtil.getProperties();
+ String lamsServerUrl = request.getParameter("lams_server_url");
+ String lamsServerSkey = request.getParameter("lams_server_skey");
+ String lamsServerId = request.getParameter("lams_server_id");
+ String bbReqSrc = request.getParameter("bb_req_src");
+
+ p.setProperty(LamsPluginUtil.PROP_LAMS_URL, lamsServerUrl);
+ p.setProperty(LamsPluginUtil.PROP_LAMS_SECRET_KEY, lamsServerSkey);
+ p.setProperty(LamsPluginUtil.PROP_LAMS_SERVER_ID, lamsServerId);
+ p.setProperty("BB_REQ_SRC", bbReqSrc);
+
+ LamsPluginUtil.setProperties(p); //persist the properties file
+%>
+
+
+ LAMS Configuration
+
+
+
'+(this.tmK.length?'':'')}function tmQ(tmg){return this.tm4.tm2['icon_'+((this.tm7?0:32)+(this.tmK.length?16:0)+(this.tmK.length&&this.tmF?8:0)+(!tmg&&this.tm4.tm6==this?4:0)+(tmg?2:0)+(tmg&&this.tmV()?1:0))]}var trees=[];tmY=document.all?function(tmh){return document.all[tmh]}:function(tmh){return document.getElementById(tmh)};
\ No newline at end of file
Index: lams_bb_integration/web/lib/tigra/tree_tpl.js
===================================================================
diff -u
--- lams_bb_integration/web/lib/tigra/tree_tpl.js (revision 0)
+++ lams_bb_integration/web/lib/tigra/tree_tpl.js (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,36 @@
+/*
+ Feel free to use your custom treeicons for the tree. Make sure they are all of the same size.
+ User treeicons collections are welcome, we'll publish them giving all regards.
+*/
+
+var TREE_TPL = {
+ 'target' : '_self', // name of the frame links will be opened in
+ // other possible values are: _blank, _parent, _search, _self and _top
+
+ 'icon_e' : '../lib/tigra/treeicons/empty.gif', // empty image
+ 'icon_l' : '../lib/tigra/treeicons/line.gif', // vertical line
+
+ 'icon_32' : '../lib/tigra/treeicons/base.gif', // root leaf icon normal
+ 'icon_36' : '../lib/tigra/treeicons/base.gif', // root leaf icon selected
+
+ 'icon_48' : '../lib/tigra/treeicons/base.gif', // root icon normal
+ 'icon_52' : '../lib/tigra/treeicons/base.gif', // root icon selected
+ 'icon_56' : '../lib/tigra/treeicons/base.gif', // root icon opened
+ 'icon_60' : '../lib/tigra/treeicons/base.gif', // root icon selected
+
+ 'icon_16' : '../lib/tigra/treeicons/folder.gif', // node icon normal
+ 'icon_20' : '../lib/tigra/treeicons/folderopen.gif', // node icon selected
+ 'icon_24' : '../lib/tigra/treeicons/folderopen.gif', // node icon opened
+ 'icon_28' : '../lib/tigra/treeicons/folderopen.gif', // node icon selected opened
+
+ 'icon_0' : '../lib/tigra/treeicons/page.gif', // leaf icon normal
+ 'icon_4' : '../lib/tigra/treeicons/page.gif', // leaf icon selected
+
+ 'icon_2' : '../lib/tigra/treeicons/joinbottom.gif', // junction for leaf
+ 'icon_3' : '../lib/tigra/treeicons/join.gif', // junction for last leaf
+ 'icon_18' : '../lib/tigra/treeicons/plusbottom.gif', // junction for closed node
+ 'icon_19' : '../lib/tigra/treeicons/plus.gif', // junctioin for last closed node
+ 'icon_26' : '../lib/tigra/treeicons/minusbottom.gif',// junction for opened node
+ 'icon_27' : '../lib/tigra/treeicons/minus.gif' // junctioin for last opended node
+};
+
Index: lams_bb_integration/web/lib/tigra/treeicons/Thumbs.db
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/base.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/empty.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/folder.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/folderopen.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/join.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/joinbottom.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/line.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/minus.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/minusbottom.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/page.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/plus.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/lib/tigra/treeicons/plusbottom.gif
===================================================================
diff -u
Binary files differ
Index: lams_bb_integration/web/modules/create.jsp
===================================================================
diff -u
--- lams_bb_integration/web/modules/create.jsp (revision 0)
+++ lams_bb_integration/web/modules/create.jsp (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,104 @@
+<%@ page import="blackboard.platform.plugin.PlugInUtil"%>
+<%@ page import="org.lamsfoundation.ld.integration.Constants"%>
+<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsSecurityUtil"%>
+<%@ page errorPage="/error.jsp"%>
+
+<%@ taglib uri="/bbData" prefix="bbData"%>
+<%@ taglib uri="/bbUI" prefix="bbUI"%>
+
+
+
+
+<%
+ // SECURITY!
+ //AccessManagerService accessManager = (AccessManagerService) BbServiceManager.lookupService(AccessManagerService.class);
+ if (!PlugInUtil.authorizeForCourseControlPanel(request,response)){
+ //accessManager.sendAccessDeniedRedirect(request,response);
+ //TODO: redirect user to login page, since sendAccessDeniedRedirect is deprecated another way is needed
+ response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+ return;
+ }
+ String authorUrl = LamsSecurityUtil.generateRequestURL(ctx, "author");
+ String learningDesigns = LamsSecurityUtil.getLearningDesigns(ctx, 2);
+%>
+
+
+ Add new LAMS
+
+
+Add new LAMS
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_bb_integration/web/modules/create_proc.jsp
===================================================================
diff -u
--- lams_bb_integration/web/modules/create_proc.jsp (revision 0)
+++ lams_bb_integration/web/modules/create_proc.jsp (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,161 @@
+<%@ page import="java.util.Calendar"%>
+<%@ page import="java.text.SimpleDateFormat"%>
+<%@ page import="blackboard.base.FormattedText"%>
+<%@ page import="blackboard.data.course.Course"%>
+<%@ page import="blackboard.data.content.Content"%>
+<%@ page import="blackboard.data.content.ContentFolder"%>
+<%@ page import="blackboard.data.content.CourseDocument"%>
+
+<%@ page import="blackboard.persist.Id"%>
+<%@ page import="blackboard.persist.BbPersistenceManager"%>
+<%@ page import="blackboard.persist.content.ContentDbPersister"%>
+<%@ page import="blackboard.persist.content.ContentDbLoader"%>
+<%@ page import="blackboard.platform.session.BbSessionManagerService"%>
+<%@ page import="blackboard.platform.session.BbSession"%>
+<%@ page import="blackboard.platform.*"%>
+<%@ page import="blackboard.platform.plugin.PlugInUtil"%>
+<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsServiceUtil"%>
+<%@ page import="org.lamsfoundation.ld.integration.blackboard.LamsPluginUtil"%>
+<%@ page import="org.lamsfoundation.ld.integration.Constants"%>
+
+
+<%@ page errorPage="/error.jsp"%><%@ page import="org.lamsfoundation.ld.integration.Constants" %>
+
+<%@ taglib uri="/bbUI" prefix="bbUI"%>
+<%@ taglib uri="/bbData" prefix="bbData"%>
+
+
+
+
+
+
+
+<%
+
+ // SECURITY!
+ //AccessManagerService accessManager = (AccessManagerService) BbServiceManager.lookupService(AccessManagerService.class);
+ if (!PlugInUtil.authorizeForCourseControlPanel(request,response)){
+ //accessManager.sendAccessDeniedRedirect(request,response);
+ //TODO: redirect user to login page, since sendAccessDeniedRedirect is deprecated another way is needed
+ response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+ return;
+ }
+
+ //check parameters
+ String p_courseId = request.getParameter("course_id");
+ String p_contentId = request.getParameter("content_id");
+ String p_learningDesignId = request.getParameter("sequence");
+ String p_descText = request.getParameter("descriptiontext");
+ String p_descType = request.getParameter("descriptiontype");
+ String p_title = request.getParameter("title");
+ if(p_courseId==null || p_contentId==null || p_learningDesignId==null || p_title==null || p_descText==null || p_descType==null){
+ throw new ServletException("requested parameters missing");
+ }
+
+ // retrieve the Db persistence manager from the persistence service
+ BbPersistenceManager bbPm = BbServiceManager.getPersistenceService().getDbPersistenceManager();
+ ContentDbPersister contentPersister = (ContentDbPersister) bbPm.getPersister( ContentDbPersister.TYPE );
+
+ // internal IDs for the course and parent content item
+ Id courseId = bbPm.generateId(Course.DATA_TYPE,request.getParameter("course_id"));
+ Id folderId = bbPm.generateId(CourseDocument.DATA_TYPE,request.getParameter("content_id"));
+
+ // learning design id
+ long ldId = Long.parseLong(p_learningDesignId);
+
+ //load parent content item
+ ContentDbLoader courseDocumentLoader = (ContentDbLoader) bbPm.getLoader( ContentDbLoader.TYPE );
+ ContentFolder courseDocParent = (ContentFolder)courseDocumentLoader.loadById( folderId );
+
+ //get the session object to obtain the user and course object
+ BbSessionManagerService sessionService = BbServiceManager.getSessionManagerService();
+ BbSession bbSession = sessionService.getSession( request );
+
+ //get username
+ String username = bbSession.getUserName();
+
+ //set LAMS content data
+ myContent.setTitle(p_title);
+ myContent.setIsAvailable(request.getParameter("isAvailable").equals("true")?true:false);
+ myContent.setIsTracked(request.getParameter("isTracked").equals("true")?true:false);
+
+ //get descriptions entered
+ FormattedText.Type descType = FormattedText.Type.DEFAULT; //type of description (S|H|P)
+ switch(p_descType.charAt(0)){
+ case 'H':
+ descType = FormattedText.Type.HTML; break;
+ case 'S':
+ descType = FormattedText.Type.SMART_TEXT; break;
+ case 'P':
+ descType = FormattedText.Type.PLAIN_TEXT; break;
+ }
+ if(!myContent.getIsAvailable()){
+ p_descText = "Item is not available. " + p_descText;
+ }
+ FormattedText description = new FormattedText(p_descText,descType);
+
+
+ //set core course data
+ myContent.setContentHandler( LamsPluginUtil.CONTENT_HANDLE );
+ myContent.setCourseId( courseId );
+ myContent.setParentId( folderId );
+
+ //set LAMS content data
+ myContent.setRenderType(Content.RenderType.URL);
+ myContent.setBody(description);
+
+ String learningSessionId = null;
+
+ //tell lams to create the learning session using webservices
+ try{
+ long lsId = LamsServiceUtil.createLearningSession(username, ldId, courseId.toExternalString(), p_title, p_descText);
+ learningSessionId = Long.toString(lsId);
+ } catch (Exception e){
+ throw new ServletException(e.getMessage(), e);
+ }
+
+
+ String contentUrl = request.getContextPath() + Constants.SERVLET_ACTION_REQUEST + '?' +
+ Constants.PARAM_METHOD + '=' + Constants.METHOD_LEARNER + '&' +
+ Constants.PARAM_LEARNING_SESSION_ID + '=' + learningSessionId + '&' +
+ Constants.PARAM_COURSE_ID + '=' + courseId.toExternalString();
+ myContent.setUrl(contentUrl);
+
+
+
+
+ //Parse start/end Date from the
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Calendar cstart = Calendar.getInstance();
+ Calendar cend = Calendar.getInstance();
+ cstart.setTime(formatter.parse(request.getParameter("startDate")));
+ cend.setTime(formatter.parse(request.getParameter("endDate")));
+
+ // Set Availability Dates
+ myContent.setStartDate(cstart);
+ if (request.getParameter("restrict_end") != null){
+ if (request.getParameter("restrict_end").equals("1")){
+ myContent.setEndDate(cend);
+ }
+ }
+
+ ContentDbPersister persister= (ContentDbPersister) bbPm.getPersister( ContentDbPersister.TYPE );
+ persister.persist( myContent );
+
+ String strReturnUrl = PlugInUtil.getEditableContentReturnURL(myContent.getParentId());
+%>
+
+
+
+
+ LAMS
+
+
+Content successfully added.
+
+
+
+
+
+
+
Index: lams_bb_integration/web/modules/js/DynamicOptionList.js
===================================================================
diff -u
--- lams_bb_integration/web/modules/js/DynamicOptionList.js (revision 0)
+++ lams_bb_integration/web/modules/js/DynamicOptionList.js (revision a225f60e82f4197c7a2bf6dbb7200709d1e852d7)
@@ -0,0 +1,584 @@
+// ===================================================================
+// Author: Matt Kruse
+// WWW: http://www.mattkruse.com/
+//
+// NOTICE: You may use this code for any purpose, commercial or
+// private, without any further permission from the author. You may
+// remove this notice from your final code if you wish, however it is
+// appreciated by the author if at least my web site address is kept.
+//
+// You may *NOT* re-distribute this code in any way except through its
+// use. That means, you can include it in your product, or your web
+// site, or any other form where the code is actually being used. You
+// may not put the plain javascript up on your site for download or
+// include it in your javascript libraries for download.
+// If you wish to share this code with others, please just point them
+// to the URL instead.
+// Please DO NOT link directly to my .js files from your site. Copy
+// the files to your server and use them there. Thank you.
+// ===================================================================
+
+// HISTORY
+// ------------------------------------------------------------------
+// Feb 15, 2005: Documentation Fix
+// March 31, 2004: First release
+/*
+
+DESCRIPTION: This library allows you to easily create select boxes whose
+contents depend on the value in a parent select box. It supports default
+options, preselected options, single or multiple-select lists, multiple
+form fields referencing the same list structure, form resetting, and most
+importantly, it's backwards-compatible way back to Netscape 4!
+
+COMPATABILITY: Netscape 4+, IE, Opera >5 (O5 didn't support new Option()),
+and should work on all other newer browsers.
+
+USAGE:
+
+ // Create a new object, passing in the fields that make up the dynamic set
+ // of lists.
+var dol = new DynamicOptionList("Field1","Child1","Child2");
+
+ // Or, you can create it empty, and pass in sets of select objects later
+var dol = new DynamicOptionList();
+dol.addDependentFields("Field1","Child1","Child2");
+
+ // Once you have the list object defined, you can additional sets of dependent
+ // fields, too. These sets will act as separate groups of related fields, but
+ // will all use the same options and data.
+dol.addDependentOptions("Field1","Child2-1","Child2-2");
+
+ // By default, the script will automatically find the form where your select
+ // objects exist. But you can explicitly set it if you wish, either by form
+ // name or index.
+dol.setFormName("MyForm");
+dol.setFormIndex(1);
+
+ // Now define the options that will exist in sub-lists. This is done in a
+ // very logical way - you say for an option in the parent, populate the child
+ // with specific options. When selecting which parent option you're dealing
+ // with, you can either select by its value or its display text. This command
+ // says, for an option in the parent list that has value="Value1", if it is
+ // selected then populate the child list with the given sub-options.
+dol.forValue("Value1").addOptions("Suboption1","Suboption2","Suboption3");
+
+ // And you can also say, for an option in the parent list that has display
+ // text of "Text1", if it is selected then populate the child list with the
+ // given sub-options.
+dol.forText("Text1").addOptions("Suboption1","Suboption2","Suboption3");
+
+ // For multi-level lists, you just continue the chain...
+ // This says, if an option with value "Value1" is selected in the first list,
+ // then an option with values "Value2" is selected in the second list, populate
+ // the third list with these options.
+dol.forValue("Value1").forValue("Value2").addOptions("1","2","3");
+
+ // If the options you want to add should have different values and dislplay
+ // text, you can do that
+dol.forValue("Value1").addOptionsTextValue("Text2","Value2");
+
+ // When an option is selected from the first list, and the options in the
+ // second list are populated, you may want to have one of the options in the
+ // child list be selected by default.
+dol.forValue("Value1").setDefaultOptions("MyValue");
+
+ // When the page first loads, you may set the values of the dependent select
+ // lists to be selected by default. For example, when a user is editing an
+ // existing record where they've already selected from the parent/child
+ // relationships. This is different from the default option in that this
+ // value is only selected when the page LOADS. If the user changes selections,
+ // this will be lost.
+dol.forField("Field1").setValues("MyPreselectedValue");
+
+ // By default, if there are is no option which should be selected in the child
+ // list, the code will automatically select the first option in the list. If
+ // you want it to instead set selectedIndex = -1 (nothing selected - works in
+ // most browsers but not all) than you can tell it to do that instead
+dol.selectFirstOption = false;
+
+// MODIFYING THE HTML
+// If you are supporting Netscape 4.x browsers, you will need to insert a call to
+// the library to populate options. This is because Netscape4 will not expand the
+// size of the select box as new options are added, so you have to "pad" the list
+// with blank options in order for it to work right.
+// This is the ONLY change you should need to make to your HTML. To do this, just
+// add a javascript block between your tags like this:
+
+
+
+// You only need to pass it the name of the select options that it should print
+// options for.
+
+
+NOTES:
+ - There seems to be an issue with Netscape6, if you hit Reload on the page. It
+ doesn't happen every time, and I can't figure out why it happens at all.
+
+ - If your select objects have onChange handlers in them, you'll need to manually
+ add a call to the DynamicOptionList code to trigger the population of the child
+ list. For example,
+
+