public class B2Context
extends java.lang.Object
For example,
B2Context b2Context = new B2Context(request);
pageContext.setAttribute("bundle", b2Context.getResourceStrings());
pageContext.setAttribute("setting", b2Context.getSettings());
will create an instance of this class and save all the resource strings from
the bb-manifest bundle for the current locale in a map named
bundle and all the systemwide setting values in a map named
setting. This allows these values to be inserted within
a JSP file using references such as:
${bundle['plugin.name']}
${setting.homeURL}
New settings can be added, or existing settings updated, as follows:
setSetting("homeURL", "/");
Changes made to setting values can be saved permanently as follows:
persistSettings();The class supports 2 types of setting (giving 4 possible combinations):
false then
the setting values will apply only to the current user and in the current
context (course or content-item). The settings file used to persist these
settings will be saved within the applicable context.
Associating anonymous global settings with a node in the Institutional Hierarchy requires Learn 9.1SP8 (or higher); accessing these settings from a module requires Learn 9.1SP10 (or higher).
| Constructor and Description |
|---|
B2Context()
Class constructor.
|
B2Context(blackboard.platform.context.Context context)
Deprecated.
|
B2Context(javax.servlet.http.HttpServletRequest request)
Class constructor using request.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addReceiptOptionsToRequest(java.lang.String success,
java.lang.String warning,
java.lang.String error)
Add receipts in current request.
|
void |
clearNode()
Clears the current node.
|
void |
clearSettings()
Deletes all global anonymous configuration settings.
|
void |
clearSettings(boolean global,
boolean anonymous,
java.lang.String suffix)
Deletes all configuration settings.
|
java.util.List<blackboard.platform.institutionalhierarchy.service.Node> |
getActiveNodes()
Gets the list of nodes for which there is at least one setting value.
|
java.util.List<blackboard.platform.institutionalhierarchy.service.Node> |
getActiveNodes(java.lang.String settingName)
Gets the list of nodes for which the named setting value exists.
|
java.lang.String |
getB2Version()
Gets the version for the current Building Block.
|
blackboard.data.content.Content |
getContent()
Gets the current content.
|
blackboard.persist.Id |
getContentId()
Gets the current content ID.
|
java.lang.String |
getContentIdAsString()
Gets the current content ID.
|
blackboard.platform.context.Context |
getContext()
Gets the current Blackboard context object.
|
blackboard.data.course.Course |
getCourse()
Gets the current course.
|
blackboard.persist.Id |
getCourseId()
Gets the current course ID.
|
java.lang.String |
getCourseIdAsString()
Gets the current course ID.
|
static boolean |
getEditMode()
Gets the current status of edit mode (Learn 9.1+).
|
blackboard.data.course.Group |
getGroup()
Gets the current group.
|
blackboard.persist.Id |
getGroupId()
Gets the current group ID.
|
java.lang.String |
getGroupIdAsString()
Gets the current group ID.
|
java.lang.String |
getHandle()
Gets the handle for the current Building Block.
|
boolean |
getIgnoreContentContext()
Gets the IgnoreContentContext setting.
|
boolean |
getIgnoreCourseContext()
Deprecated.
|
boolean |
getIgnoreGroupContext()
Gets the IgnoreGroupContext setting.
|
boolean |
getInheritSettings()
Gets the current inherit settings value.
|
boolean |
getIsActiveNode()
Checks if the current node has any settings.
|
boolean |
getIsActiveNode(java.lang.String settingName)
Checks if the current node has a setting of a specified name.
|
boolean |
getIsB2Version(int major,
int minor,
int build)
Checks whether the current Building Block is at a specific version, or later.
|
boolean |
getIsRootNode()
Checks if the current node is the root of the Institutional Hierarchy.
|
static boolean |
getIsVersion(int major,
int minor,
int servicePack)
Checks whether the Blackboard is at a specific release, or later.
|
static boolean |
getLogDebug()
Gets the debug level for the logger.
|
blackboard.data.navigation.NavigationItem |
getNavigationItem(java.lang.String name)
Gets a named navigation item.
|
blackboard.platform.institutionalhierarchy.service.Node |
getNode()
Gets the current node.
|
static boolean |
getNodeSupport()
Gets the current node support setting.
|
java.lang.String |
getPath()
Gets the path for the current Building Block.
|
java.lang.String |
getPath(java.lang.String schema)
Gets the path for the current Building Block using a specified schema name.
|
blackboard.platform.plugin.PlugIn |
getPlugIn()
Gets the plugin object for this building block.
|
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the current request object.
|
javax.servlet.http.HttpServletRequest |
getRequest(boolean unfiltered)
Gets the current request object.
|
java.lang.String |
getRequestParameter(java.lang.String name,
java.lang.String defaultValue)
Gets a parameter from the current request object.
|
java.lang.String |
getRequestParameter(java.lang.String name,
java.lang.String defaultValue,
boolean unfiltered)
Gets a parameter from the current request object.
|
java.util.Map<java.lang.String,java.lang.String> |
getRequestParameters()
Gets the values of all parameters from a request object.
|
java.util.Map<java.lang.String,java.lang.String> |
getRequestParameters(boolean unfiltered)
Gets the values of all parameters from a request object.
|
java.lang.String |
getRequestParameterValues(java.lang.String name,
java.lang.String defaultValue)
Gets the values for a parameter from a request object.
|
java.lang.String |
getRequestParameterValues(java.lang.String name,
java.lang.String defaultValue,
boolean unfiltered)
Gets the values for a parameter from a request object.
|
java.lang.String |
getResourceString(java.lang.String key)
Gets a resource string from the bundle for the current locale.
|
java.lang.String |
getResourceString(java.lang.String key,
java.lang.String defaultValue)
Gets a resource string from the bundle for the current locale.
|
java.util.Map<java.lang.String,java.lang.String> |
getResourceStrings()
Gets all the resource strings from the bundle for the current locale.
|
boolean |
getSaveEmptyValues()
Gets the SaveEmptyValues setting.
|
java.lang.String |
getSchema()
Gets the schema for the current Learn 9 instance.
|
java.lang.String |
getServerUrl()
Gets the path for the current Building Block.
|
java.lang.String |
getSetting(boolean global,
boolean anonymous,
java.lang.String key)
Gets a configuration setting value.
|
java.lang.String |
getSetting(boolean global,
boolean anonymous,
java.lang.String key,
java.lang.String defaultValue)
Gets a configuration setting value.
|
java.lang.String |
getSetting(boolean global,
boolean anonymous,
java.lang.String key,
java.lang.String defaultValue,
blackboard.platform.institutionalhierarchy.service.Node aNode)
Gets a configuration setting value from a specific node.
|
java.lang.String |
getSetting(java.lang.String key)
Gets a global anonymous configuration setting value.
|
java.lang.String |
getSetting(java.lang.String key,
java.lang.String defaultValue)
Gets a global anonymous configuration setting value.
|
java.util.Map<java.lang.String,java.lang.String> |
getSettings()
Gets a list of all global anonymous configuration settings.
|
java.util.Map<java.lang.String,java.lang.String> |
getSettings(boolean global,
boolean anonymous)
Gets a list of all configuration settings.
|
java.util.Map<java.lang.String,java.lang.String> |
getSettings(boolean global,
boolean anonymous,
boolean nodeOnly)
Gets a list of all configuration settings.
|
java.util.Map<java.lang.String,java.lang.String> |
getSettings(boolean global,
boolean anonymous,
java.lang.String fileSuffix)
Gets a list of all configuration settings.
|
java.util.Map<java.lang.String,java.lang.String> |
getSettings(boolean global,
boolean anonymous,
java.lang.String fileSuffix,
boolean nodeOnly)
Gets a list of all configuration settings.
|
java.util.Map<java.lang.String,java.lang.String> |
getSettings(java.lang.String fileSuffix)
Gets a list of all global anonymous configuration settings.
|
blackboard.data.user.User |
getUser()
Gets the current user.
|
blackboard.persist.Id |
getUserId()
Gets the current user ID.
|
java.lang.String |
getUserIdAsString()
Gets the current user ID.
|
java.lang.String |
getVendorId()
Gets the vendor ID for the current Building Block.
|
static int[] |
getVersionNumber()
Gets the Blackboard version number as an array of its elements.
|
static java.lang.String |
getVersionNumber(java.lang.String defaultValue)
Gets the Blackboard version number.
|
java.lang.String |
getWebappRoot()
Gets the file root for the current Building Block.
|
boolean |
hasContentContext()
Checks if the current context has a Content reference.
|
boolean |
hasCourseContext()
Checks if the current context has a Course reference.
|
boolean |
hasGroupContext()
Checks if the current context has a Group reference.
|
boolean |
hasUserContext()
Checks if the current context has a User reference.
|
static void |
log(boolean isError,
java.lang.String message)
Sends a log message to the
logs/bb-services-log.txt file. |
static void |
log(boolean isError,
java.lang.String prefix,
java.lang.Object obj)
Sends an object to the
logs/bb-services-log.txt file. |
static void |
log(java.lang.String message)
Sends an error message to the
logs/bb-services-log.txt file. |
void |
persistSettings()
Permanently saves the current global anonymous configuration setting values.
|
void |
persistSettings(boolean global,
boolean anonymous)
Permanently saves the current configuration setting values.
|
void |
persistSettings(boolean global,
boolean anonymous,
java.util.Properties properties)
Permanently saves a set of setting values.
|
void |
persistSettings(boolean global,
boolean anonymous,
java.lang.String suffix,
java.util.Map<java.lang.String,java.lang.String> settings)
Permanently saves the current configuration setting values.
|
void |
persistSettings(java.lang.String suffix,
java.util.Map<java.lang.String,java.lang.String> settings)
Permanently saves the global anonymous configuration setting values.
|
static void |
processCourseCopy(blackboard.platform.cx.component.CopyControl copyControl)
Processes changes arising from a course copy.
|
static java.util.Map<java.lang.String,java.lang.String> |
processCourseExport(blackboard.platform.cx.component.ExportControl exportControl)
Processes changes arising from a course export/archive.
|
static void |
processCourseImport(blackboard.platform.cx.component.ImportControl importControl,
java.util.Properties props)
Processes changes arising from a course export/archive.
|
void |
setContent(blackboard.data.content.Content content)
Sets the current content.
|
void |
setContentId(blackboard.persist.Id contentId)
Sets the current content ID.
|
boolean |
setContentId(java.lang.String contentIdString)
Sets the current content ID.
|
void |
setContext(blackboard.platform.context.Context context)
Deprecated.
|
void |
setCourse(blackboard.data.course.Course course)
Sets the current course.
|
void |
setCourseId(blackboard.persist.Id courseId)
Sets the current course ID.
|
boolean |
setCourseId(java.lang.String courseIdString)
Sets the current course ID.
|
void |
setGroup(blackboard.data.course.Group group)
Sets the current group.
|
void |
setGroupId(blackboard.persist.Id groupId)
Sets the current group ID.
|
boolean |
setGroupId(java.lang.String groupIdString)
Sets the current group ID.
|
void |
setIgnoreContentContext(boolean ignoreContentContext)
Sets the IgnoreContentContext setting.
|
void |
setIgnoreCourseContext(boolean ignoreCourseContext)
Deprecated.
|
void |
setIgnoreGroupContext(boolean ignoreGroupContext)
Sets the IgnoreGroupContext setting.
|
void |
setInheritSettings(boolean inheritSettings)
Gets the current inherit settings value.
|
static void |
setLogDebug(boolean logDebugSetting)
Sets the debug level for the logger.
|
void |
setNode(blackboard.platform.institutionalhierarchy.service.Node aNode)
Sets the current node.
|
void |
setReceipt(java.lang.String message)
Sets a success receipt option.
|
void |
setReceipt(java.lang.String message,
boolean isSuccess)
Sets a success or error receipt option.
|
void |
setReceipt(java.lang.String message,
java.lang.Exception exception)
Sets a warning receipt option.
|
void |
setReceiptOptions(java.lang.String success,
java.lang.String error)
Set receipts in session.
|
java.lang.String |
setReceiptOptions(java.lang.String url,
java.lang.String success,
java.lang.String error)
Set receipts to a URL.
|
void |
setSaveEmptyValues(boolean saveEmptyValues)
Sets the SaveEmptyValues setting.
|
void |
setSetting(boolean global,
boolean anonymous,
java.lang.String key,
java.lang.String value)
Adds a configuration setting value.
|
void |
setSetting(java.lang.String key,
java.lang.String value)
Adds a global anonymous configuration setting value.
|
void |
setUser(blackboard.data.user.User user)
Sets the current user.
|
void |
setUserId(blackboard.persist.Id userId)
Sets the current user ID.
|
boolean |
setUserId(java.lang.String userIdString)
Sets the current user ID.
|
public B2Context(blackboard.platform.context.Context context)
context - the current context objectpublic B2Context(javax.servlet.http.HttpServletRequest request)
request - the current request objectpublic B2Context()
public javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.http.HttpServletRequest getRequest(boolean unfiltered)
unfiltered - true if an unfiltered value should be returnedpublic boolean getInheritSettings()
true if settings are being inherited by nodespublic void setInheritSettings(boolean inheritSettings)
inheritSettings - true if settings are to be inherited by nodespublic static boolean getNodeSupport()
true if node support is enabledpublic blackboard.platform.institutionalhierarchy.service.Node getNode()
public void clearNode()
public void setNode(blackboard.platform.institutionalhierarchy.service.Node aNode)
aNode - the nodepublic boolean getIsRootNode()
true if the current node is the root of the Institutional Hierarchypublic java.util.List<blackboard.platform.institutionalhierarchy.service.Node> getActiveNodes()
public java.util.List<blackboard.platform.institutionalhierarchy.service.Node> getActiveNodes(java.lang.String settingName)
settingName - name of setting to confirm node is active (null for any setting)public boolean getIsActiveNode()
true if the current node has at least one settingpublic boolean getIsActiveNode(java.lang.String settingName)
settingName - name of setting to check for (null for any name)true if the current node has the setting specifiedpublic blackboard.platform.context.Context getContext()
public void setUser(blackboard.data.user.User user)
user - The current userpublic blackboard.data.user.User getUser()
public void setCourse(blackboard.data.course.Course course)
course - The current coursepublic blackboard.data.course.Course getCourse()
public void setGroup(blackboard.data.course.Group group)
group - The current grouppublic blackboard.data.course.Group getGroup()
public void setContent(blackboard.data.content.Content content)
content - The current contentpublic blackboard.data.content.Content getContent()
public void setUserId(blackboard.persist.Id userId)
userId - the user IDpublic boolean setUserId(java.lang.String userIdString)
userIdString - the user ID as a stringtrue if the user ID was setpublic boolean hasUserContext()
true if a User reference existspublic blackboard.persist.Id getUserId()
public java.lang.String getUserIdAsString()
public void setCourseId(blackboard.persist.Id courseId)
courseId - the course IDpublic boolean setCourseId(java.lang.String courseIdString)
courseIdString - the course ID as a stringtrue if the course ID was setpublic boolean hasCourseContext()
true if a Course reference existspublic blackboard.persist.Id getCourseId()
public java.lang.String getCourseIdAsString()
public void setGroupId(blackboard.persist.Id groupId)
groupId - the group IDpublic boolean setGroupId(java.lang.String groupIdString)
groupIdString - the group ID as a stringtrue if the group ID was setpublic boolean hasGroupContext()
true if a Group reference existspublic blackboard.persist.Id getGroupId()
public java.lang.String getGroupIdAsString()
public void setContentId(blackboard.persist.Id contentId)
contentId - the content IDpublic boolean setContentId(java.lang.String contentIdString)
contentIdString - the content ID as a stringtrue if the content ID was setpublic boolean hasContentContext()
true if a Content reference existspublic blackboard.persist.Id getContentId()
public java.lang.String getContentIdAsString()
public void setContext(blackboard.platform.context.Context context)
context - the context objectpublic java.lang.String getVendorId()
public java.lang.String getHandle()
public java.lang.String getSchema()
public java.lang.String getB2Version()
public boolean getIsB2Version(int major,
int minor,
int build)
For example, to check if the current version of the Building Block is 2.12.5, or later use parameters of 2, 12 and 5.
major - the major release numberminor - the minor release numberbuild - the build numbertrue if this building block has the specified version number or greaterpublic java.lang.String getServerUrl()
public java.lang.String getPath()
public java.lang.String getPath(java.lang.String schema)
schema - name of schema to use in pathpublic java.lang.String getWebappRoot()
public java.lang.String getRequestParameter(java.lang.String name,
java.lang.String defaultValue)
The default value is returned if no value exists for the specified parameter.
name - the name of the request parameterdefaultValue - the default valuepublic java.lang.String getRequestParameter(java.lang.String name,
java.lang.String defaultValue,
boolean unfiltered)
The default value is returned if no value exists for the specified parameter.
name - the name of the request parameterdefaultValue - the default valueunfiltered - true if an unfiltered value should be returnedpublic java.lang.String getRequestParameterValues(java.lang.String name,
java.lang.String defaultValue)
If more than one value is included in the request for the specified parameter, the values are concatenated into a single string separated by a comma.
The default value is returned if no value exists for the specified parameter.
name - the name of the request parameterdefaultValue - the default valuepublic java.lang.String getRequestParameterValues(java.lang.String name,
java.lang.String defaultValue,
boolean unfiltered)
If more than one value is included in the request for the specified parameter, the values are concatenated into a single string separated by a comma.
The default value is returned if no value exists for the specified parameter.
name - the name of the request parameterdefaultValue - the default valueunfiltered - true if unfiltered values should be returnedpublic java.util.Map<java.lang.String,java.lang.String> getRequestParameters()
If more than one value is included in the request for a parameter, the values are concatenated into a single entry separated by a comma.
public java.util.Map<java.lang.String,java.lang.String> getRequestParameters(boolean unfiltered)
If more than one value is included in the request for a parameter, the values are concatenated into a single entry separated by a comma.
unfiltered - true if unfiltered values should be returnedpublic blackboard.platform.plugin.PlugIn getPlugIn()
public java.lang.String getResourceString(java.lang.String key)
The resource strings are loaded from the bb-manifest bundle file
for the current locale as located in the WEB-INF/bundles
directory.
key - the name of the resource stringpublic java.lang.String getResourceString(java.lang.String key,
java.lang.String defaultValue)
The default value is returned if no value exists for the specified key.
The resource strings are loaded from the bb-manifest bundle file
for the current locale as located in the WEB-INF/bundles
directory.
key - the name of the resource stringdefaultValue - the default valuepublic java.util.Map<java.lang.String,java.lang.String> getResourceStrings()
The resource strings are loaded from the bb-manifest bundle file
for the current locale as located in the WEB-INF/bundles
directory.
public boolean getSaveEmptyValues()
public void setSaveEmptyValues(boolean saveEmptyValues)
saveEmptyValues - true (default) if settings with empty values should be saved; false if settings should be deleted if they have no value (empty string)public boolean getIgnoreCourseContext()
public void setIgnoreCourseContext(boolean ignoreCourseContext)
ignoreCourseContext - true if the existence of a course context is to be ignored (default = true)public boolean getIgnoreGroupContext()
public void setIgnoreGroupContext(boolean ignoreGroupContext)
ignoreGroupContext - true if the existence of a group context is to be ignored (default = true)public boolean getIgnoreContentContext()
public void setIgnoreContentContext(boolean ignoreContentContext)
ignoreContentContext - true if the existence of a content context is to be ignored (default = true)public java.lang.String getSetting(java.lang.String key)
The global anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. This file is located in the Building Block
config directory.
key - the name of the settingpublic java.lang.String getSetting(boolean global,
boolean anonymous,
java.lang.String key)
Anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. Files containing global settings are located in the
Building Block config directory. Non-global settings files are
located in the content directory (for content-item tools) or the course directory
(for course tools).
Non-anonymous settings are retrieved from the Blackboard user registry.
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all userskey - the name of the settingpublic java.lang.String getSetting(java.lang.String key,
java.lang.String defaultValue)
The default value is returned if no value exists for the specified key.
The global anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. This file is located in the Building Block
config directory.
key - the name of the settingdefaultValue - the default value of the settingpublic java.lang.String getSetting(boolean global,
boolean anonymous,
java.lang.String key,
java.lang.String defaultValue)
The default value is returned if no value exists for the specified key.
Anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. Files containing global settings are located in the
Building Block config directory. Non-global settings files are
located in the content directory (for content-item tools) or the course directory
(for course tools).
Non-anonymous settings are retrieved from the Blackboard user registry.
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all userskey - the name of the settingdefaultValue - the default value of the settingpublic java.lang.String getSetting(boolean global,
boolean anonymous,
java.lang.String key,
java.lang.String defaultValue,
blackboard.platform.institutionalhierarchy.service.Node aNode)
The default value is returned if no value exists for the specified key.
Anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. Files containing global settings are located in the
Building Block config directory. Non-global settings files are
located in the content directory (for content-item tools) or the course directory
(for course tools).
Non-anonymous settings are retrieved from the Blackboard user registry.
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all userskey - the name of the settingdefaultValue - the default value of the settingaNode - the node to get the setting value frompublic java.util.Map<java.lang.String,java.lang.String> getSettings()
The global anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. This file is located in the Building Block
config directory.
public java.util.Map<java.lang.String,java.lang.String> getSettings(boolean global,
boolean anonymous)
Anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. Files containing global settings are located in the
Building Block config directory. Non-global settings files are
located in the content directory (for content-item tools) or the course directory
(for course tools).
Non-anonymous settings are retrieved from the Blackboard user registry.
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all userspublic java.util.Map<java.lang.String,java.lang.String> getSettings(boolean global,
boolean anonymous,
boolean nodeOnly)
Anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. Files containing global settings are located in the
Building Block config directory. Non-global settings files are
located in the content directory (for content-item tools) or the course directory
(for course tools).
Non-anonymous settings are retrieved from the Blackboard user registry.
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all usersnodeOnly - true if only settings specified at the current node level should be returnedpublic java.util.Map<java.lang.String,java.lang.String> getSettings(java.lang.String fileSuffix)
The global anonymous configuration settings are loaded from a file named
vvvv-hhhhhh-x.properties where
vvvv and hhhhhh are the vendor ID and handle for the
current Building Block, respectively, and x is the specified suffix.
This file is located in the Building Block config directory.
fileSuffix - suffix of the settings file namepublic java.util.Map<java.lang.String,java.lang.String> getSettings(boolean global,
boolean anonymous,
java.lang.String fileSuffix)
Anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. Files containing global settings are located in the
Building Block config directory. Non-global settings files are
located in the content directory (for content-item tools) or the course directory
(for course tools).
Non-anonymous settings are retrieved from the Blackboard user registry.
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all usersfileSuffix - suffix of the settings file namepublic java.util.Map<java.lang.String,java.lang.String> getSettings(boolean global,
boolean anonymous,
java.lang.String fileSuffix,
boolean nodeOnly)
Anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. Files containing global settings are located in the
Building Block config directory. Non-global settings files are
located in the content directory (for content-item tools) or the course directory
(for course tools).
Non-anonymous settings are retrieved from the Blackboard user registry.
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all usersfileSuffix - suffix of the settings file namenodeOnly - true if only settings specified at the current node level should be returnedpublic void setSetting(java.lang.String key,
java.lang.String value)
If no value exists for the setting then it is added, otherwise the
existing entry is updated. Null values are ignored and
any existing entry for the setting is deleted.
Note: this only saves the setting value in memory; use the
method to permanently
save the values.persistSettings()
key - the name of the settingvalue - the value of the settingpublic void setSetting(boolean global,
boolean anonymous,
java.lang.String key,
java.lang.String value)
If no value exists for the setting then it is added, otherwise the
existing entry is updated. Null values are ignored and
any existing entry for the setting is deleted.
Note: this only saves the setting value in memory; use the
method to permanently
save the values.persistSettings()
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all userskey - the name of the settingvalue - the value of the settingpublic void clearSettings()
Note: this only clears the setting values in memory; use the
method to permanently
delete the values.persistSettings()
public void clearSettings(boolean global,
boolean anonymous,
java.lang.String suffix)
Note: this only clears the setting values in memory; use the
method to permanently
delete the values.persistSettings()
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all userssuffix - public void persistSettings()
The global anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. This file is located in the Building Block
config directory.
public void persistSettings(boolean global,
boolean anonymous)
Anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. Files containing global settings are located in the
Building Block config directory. Non-global settings files are
located in the content directory (for content-item tools) or the course directory
(for course tools).
Non-anonymous settings are saved to the Blackboard user registry.
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all userspublic void persistSettings(boolean global,
boolean anonymous,
java.util.Properties properties)
Anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. Files containing global settings are located in the
Building Block config directory. Non-global settings files are
located in the content directory (for content-item tools) or the course directory
(for course tools).
Non-anonymous settings are saved to the Blackboard user registry.
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all usersproperties - a properties object containing the settings to be savedpublic void persistSettings(java.lang.String suffix,
java.util.Map<java.lang.String,java.lang.String> settings)
suffix - suffix of the settings file namesettings - Map containing the settings to savepublic void persistSettings(boolean global,
boolean anonymous,
java.lang.String suffix,
java.util.Map<java.lang.String,java.lang.String> settings)
Anonymous configuration settings are loaded from a file named
vvvv-hhhhhh.properties where vvvv and
hhhhhh are the vendor ID and handle for the current Building
Block, respectively. Files containing global settings are located in the
Building Block config directory. Non-global settings files are
located in the content directory (for content-item tools) or the course directory
(for course tools).
Non-anonymous settings are saved to the Blackboard user registry.
global - true if the setting applies to all instances of the toolanonymous - true if the setting applies to all userssuffix - suffix for the settings setsettings - Map containing the settings to savepublic blackboard.data.navigation.NavigationItem getNavigationItem(java.lang.String name)
name - name of navigation itempublic void setReceipt(java.lang.String message)
message - message to be displayedpublic void setReceipt(java.lang.String message,
boolean isSuccess)
message - message to be displayedisSuccess - true if this is a success receiptpublic void setReceipt(java.lang.String message,
java.lang.Exception exception)
message - message to be displayedexception - error exception or null for a success receiptpublic void setReceiptOptions(java.lang.String success,
java.lang.String error)
success - success message to be displayederror - error message to be displayedpublic void addReceiptOptionsToRequest(java.lang.String success,
java.lang.String warning,
java.lang.String error)
success - success message to be displayedwarning - warning message to be displayederror - error message to be displayedpublic java.lang.String setReceiptOptions(java.lang.String url,
java.lang.String success,
java.lang.String error)
url - URLsuccess - success message to be displayederror - error message to be displayedpublic static boolean getEditMode()
false if edit mode is off or Learn 9.0, otherwise truepublic static void processCourseCopy(blackboard.platform.cx.component.CopyControl copyControl)
copyControl - the CopyControl object for the course copy in progresspublic static java.util.Map<java.lang.String,java.lang.String> processCourseExport(blackboard.platform.cx.component.ExportControl exportControl)
exportControl - the ExportControl object for the course export/archive in progresspublic static void processCourseImport(blackboard.platform.cx.component.ImportControl importControl,
java.util.Properties props)
importControl - the ImportControl object for the course import in progressprops - the properties saved during the export of the file being importedpublic static java.lang.String getVersionNumber(java.lang.String defaultValue)
defaultValue - the default value to return when unable to access version numberpublic static int[] getVersionNumber()
The third element is split into two to separate the service pack from the build number.
public static boolean getIsVersion(int major,
int minor,
int servicePack)
For example, to check if the current version of Blackboard is 9.1 SP10, or later use parameters of 9, 1 and 10. For the Q4 2017 CU1 release (or later) use parameters of 3300, 0 and 1.
major - the major release numberminor - the minor release numberservicePack - the service pack numbertrue if the Blackboard release has the specified version number or greaterpublic static boolean getLogDebug()
true if information messages are to be logged as well as errorspublic static void setLogDebug(boolean logDebugSetting)
logDebugSetting - true if information messages are to be logged as well as errorspublic static void log(java.lang.String message)
logs/bb-services-log.txt file.message - error to be loggedpublic static void log(boolean isError,
java.lang.String prefix,
java.lang.Object obj)
logs/bb-services-log.txt file.isError - true if the message being logged is an error; false if it is just for informationprefix - prefix to log before objectobj - object to be loggedpublic static void log(boolean isError,
java.lang.String message)
logs/bb-services-log.txt file.isError - true if the message being logged is an error; false if it is just for informationmessage - string to be logged