blackboard.portal.external
Class CustomData

java.lang.Object
  extended by blackboard.portal.external.CustomData

public class CustomData
extends java.lang.Object

The CustomData class provides module developers access to read and edit custom data associated either with the module in general or with a users specific personalization settings. The different static factory methods provide access to the different types of custom data.

CustomData is stored in the Blackboard Learning System database for each user and each module that invokes it. CustomData information is only removed when either the module or the user associated with the CustomData information is deleted from the system. Be aware that, in unusual circumstances, this could result in some larger than anticipated database growth.

Since:
Bb 6.0
Version:
$Revision: #1 $ $Date: 2005/06/27 $

Method Summary
static CustomData getCustomData(Id moduleId, Id portalViewerId)
          Get CustomData without detailed reference to PortalRequestContext information.
 java.util.Enumeration getKeys()
          Returns the Enumeration of keys for the portal data contained within this object.
static CustomData getModuleData(javax.servlet.jsp.PageContext pageContext)
          Load the CustomData associated with the module's general data.
static CustomData getModulePersonalizationData(javax.servlet.jsp.PageContext pageContext)
          Load the CustomData associated with the module's personalization data.
 java.lang.Object getObjectValue(java.lang.String key)
          Returns the Object property associated with the given key.
 java.lang.String getValue(java.lang.String key)
          Returns the String property associated with the given key.
 void save()
          Saves the CustomData object.
 void setObjectValue(java.lang.String key, java.lang.Object value)
          Sets a new Object property associated with the given key.
 void setValue(java.lang.String key, java.lang.String value)
          Sets a new String property associated with the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCustomData

public static CustomData getCustomData(Id moduleId,
                                       Id portalViewerId)
                                throws PersistenceException,
                                       ValidationException
Get CustomData without detailed reference to PortalRequestContext information.

Throws:
ValidationException
PersistenceException

getModuleData

public static CustomData getModuleData(javax.servlet.jsp.PageContext pageContext)
                                throws PersistenceException,
                                       ValidationException
Load the CustomData associated with the module's general data.

Parameters:
pageContext - the pageContext object from the Jsp Page
Throws:
ValidationException - if there are problems creating the custom data on first ever access
PersistenceException - if some other error occurs while trying to load the object

getModulePersonalizationData

public static CustomData getModulePersonalizationData(javax.servlet.jsp.PageContext pageContext)
                                               throws PersistenceException,
                                                      ValidationException
Load the CustomData associated with the module's personalization data.

Parameters:
pageContext - the pageContext object from the Jsp Page
Throws:
ValidationException - if there are problems creating the custom data on first ever access
PersistenceException - if some other error occurs while trying to load the object

save

public void save()
          throws PersistenceException,
                 ValidationException
Saves the CustomData object.

Parameters:
pageContext - the pageContext object from the Jsp Page
Throws:
ValidationException - if there are problems creating the custom data on first ever access
PersistenceException - if some other error occurs while trying to load the object

getKeys

public java.util.Enumeration getKeys()
Returns the Enumeration of keys for the portal data contained within this object.

Parameters:
-
Returns:
keys The Enumeration of keys for the portal data contained within this object.

getValue

public java.lang.String getValue(java.lang.String key)
Returns the String property associated with the given key.

Parameters:
key - The key specifying specific property of the custom data
Returns:
value The new value for the property with the specified key.

setValue

public void setValue(java.lang.String key,
                     java.lang.String value)
Sets a new String property associated with the given key.

Parameters:
key - The key specifying specific property of the custom data
value - The new value for the property with the specified key.

getObjectValue

public java.lang.Object getObjectValue(java.lang.String key)
Returns the Object property associated with the given key. This "Object" is converted using toExternalString() before it is persisted in the database. Don't expect a standard Object to do what you think here.

Parameters:
key - The key specifying specific property of the custom data
Returns:
value The new value for the property with the specified key.

setObjectValue

public void setObjectValue(java.lang.String key,
                           java.lang.Object value)
Sets a new Object property associated with the given key. This "Object" is converted using toExternalString() before it is persisted in the database. Don't expect a standard Object to do what you think here.

Parameters:
key - The key specifying specific property of the custom data
value - The new value for the property with the specified key.


Copyright © 2003 Blackboard, Inc. All Rights Reserved.