blackboard.persist.content
Interface ContentDbLoader

All Superinterfaces:
Loader

public interface ContentDbLoader
extends Loader

This interface describes the set of methods that all database loaders for Content objects must implement. This loader is capable of loading all defined "types" of content (documents, folder, links, etc.).

Loading methods are named according to the criteria used for loading and the type of load that is performed. Loading operations can be either "lightweight" or "heavyweight". Lightweight loads load only those values directly associated with a data object (the immediate properties of an object). Heavyweight loads load those values directly associated with an object as well as the values of those objects directly contained by the object. Heavyweight loads are optimized to be as efficient as possible, but because more data is loaded performance will be slower than that of lightweight loads. As a result, lightweight load should be performed whenever possible.

Because of the tree structure of content (content and folders), some load operations can also be "deep". A "deep" load, loads an entire tree of content, while a "non-deep" load, loads only those content items at a specific level within the tree structure.

Since:
Bb 6.0
Version:
$Revision: 5 $ $Date: 3/14/02 11:35a $

Nested Class Summary
static class ContentDbLoader.Default
          A utility class that provides quick access to the ContentDbLoader instance associated with the default instance of the database BbPersistenceManager.
 
Field Summary
static java.lang.String TYPE
          Type used to obtain an instance of the class configured to provide the implementation for this interface.
 
Method Summary
 Content loadById(Id id)
          Load the Content with the given Id from the database in a lightweight fashion using a connection obtained through this object's database context.
 Content loadById(Id id, java.sql.Connection con)
          Load the Content with the given Id from the database in a lightweight fashion using the supplied connection.
 Content loadById(Id id, java.sql.Connection con, boolean bDeep, boolean bHeavy)
          Loads the Content with the given Id from the database in the specified fashion (lightweight or heavyweight) using the supplied connection.
 Content loadByTocId(Id tocId)
          Load the Content item that is the "Top" folder for the specified blackboard.data.navigation.CourseToc (identified by Id) in a lightweight fashion using a connection obtained through this object's database context.
 Content loadByTocId(Id tocId, java.sql.Connection con)
          Load the Content item that is the "Top" folder for the specified blackboard.data.navigation.CourseToc (identified by Id) in a lightweight fashion using the supplied connection.
 Content loadByTocId(Id tocId, java.sql.Connection con, boolean bDeep)
          Load the Content item that is the "Top" folder for the specified blackboard.data.navigation.CourseToc (identified by Id) in a lightweight fashion using the supplied connection.
 BbList loadChildren(Id id)
          Loads a list containing the immediate children of the specified Content item (identified by Id) from the database in a lightweight fashion using a connection obtained through this object's database context.
 BbList loadChildren(Id id, java.sql.Connection con)
          Loads a list containing the immediate children of the specified Content item (identified by Id) from the database in a lightweight fashion using a connection obtained through this object's database context.
 BbList loadContentPath(Id id)
          Loads a list of content items containing the specified Content item (identified by Id) along with all of its ancestors from the database in a lightweight fashion using a connection obtained through this object's database context.
 BbList loadContentPath(Id id, java.sql.Connection con)
          Loads a list of content items containing the specified Content item (identified by Id) along with all of its ancestors from the database in a lightweight fashion using a connection obtained through this object's database context.
 BbList loadListById(Id id)
          Loads a list of Content by performing a deep load rooted at the content item with the given Id.
 BbList loadListById(Id id, java.sql.Connection con)
          Loads a list of Content by performing a deep load rooted at the content item with the given Id.
 BbList loadListById(Id id, java.sql.Connection con, boolean bHeavy)
          Loads a list of Content by performing a deep load rooted at the content item with the given Id.
 
Methods inherited from interface blackboard.persist.Loader
getAppVersion, init
 

Field Detail

TYPE

public static final java.lang.String TYPE
Type used to obtain an instance of the class configured to provide the implementation for this interface. Used when making a call to BbPersistenceManager.getLoader(String).

See Also:
Constant Field Values
Method Detail

loadById

public Content loadById(Id id)
                 throws KeyNotFoundException,
                        PersistenceException
Load the Content with the given Id from the database in a lightweight fashion using a connection obtained through this object's database context.

If id references an aggregate type, and you want to load all of the contained items and/or related objects such as files, use loadById(Id,Connection,boolean,boolean).

Parameters:
id - the Id of the Content that should be loaded
Throws:
KeyNotFoundException - if there is no Content in the database with the given id
PersistenceException - if some other error occurs while loading the object

loadById

public Content loadById(Id id,
                        java.sql.Connection con)
                 throws KeyNotFoundException,
                        PersistenceException
Load the Content with the given Id from the database in a lightweight fashion using the supplied connection.

If id references an aggregate type, and you want to load all of the contained items and/or related objects such as files, use loadById(Id,Connection,boolean,boolean).

Parameters:
id - the Id of the Content that should be loaded
con - the Connection to use to perform the load. Can be null.
Throws:
KeyNotFoundException - if there is no Content in the database with the given id
PersistenceException - if some other error occurs while loading the object

loadById

public Content loadById(Id id,
                        java.sql.Connection con,
                        boolean bDeep,
                        boolean bHeavy)
                 throws KeyNotFoundException,
                        PersistenceException
Loads the Content with the given Id from the database in the specified fashion (lightweight or heavyweight) using the supplied connection.

If a deep load is requested, and the specified content item is an aggregate type, all descendants of the specified content item will also be loaded such that the returned content item will represent the root node in a content tree. If the requested load is not deep, only the specified content item will be loaded.

Parameters:
id - the Id of the Content that should be loaded
con - the Connection to use to perform the load. Can be null.
bDeep - a boolean value denoting whether a "deep" load should be performed.
bHeavy - a boolean value denoting whether a "heavy" load should be performed.
Throws:
KeyNotFoundException - if there is no Content in the database with the given id
PersistenceException - if some other error occurs while loading the object

loadListById

public BbList loadListById(Id id)
                    throws KeyNotFoundException,
                           PersistenceException
Loads a list of Content by performing a deep load rooted at the content item with the given Id. The load is performed in a lightweight fashion using a connection obtained through this object's database context.

If the specified content item is not an aggregate type, it will have no descendants and the returned list will thus contain only one content item -- the content item with the provided Id.

The order of content items within the returned list is such that parent content items will always appear in the list before their children content items, and within a particular content folder, the order of content items is preserved. The first item in the list will always be the content item within the provided Id.

Parameters:
id - the Id of the Content that should be treated as the root node for the load operation
Throws:
KeyNotFoundException - if the provided content Id is invalid
PersistenceException - if some other error occurs while loading the object

loadListById

public BbList loadListById(Id id,
                           java.sql.Connection con)
                    throws KeyNotFoundException,
                           PersistenceException
Loads a list of Content by performing a deep load rooted at the content item with the given Id. The load is performed in a lightweight fashion using the supplied connection.

If the specified content item is not an aggregate type, it will have no descendants and the returned list will thus contain only one content item -- the content item with the provided Id.

The order of content items within the returned list is such that parent content items will always appear in the list before their children content items, and within a particular content folder, the order of content items is preserved. The first item in the list will always be the content item within the provided Id.

Parameters:
id - the Id of the Content that should be treated as the root node for the load operation
con - the Connection to use to perform the load. Can be null.
Throws:
KeyNotFoundException - if the provided content Id is invalid
PersistenceException - if some other error occurs while loading the object

loadListById

public BbList loadListById(Id id,
                           java.sql.Connection con,
                           boolean bHeavy)
                    throws KeyNotFoundException,
                           PersistenceException
Loads a list of Content by performing a deep load rooted at the content item with the given Id. The load is performed in the specified fashion (lightweight or heavyweight) using the supplied connection.

If the specified content item is not an aggregate type, it will have no descendants and the returned list will thus contain only one content item -- the content item with the provided Id.

The order of content items within the returned list is such that parent content items will always appear in the list before their children content items, and within a particular content folder, the order of content items is preserved. The first item in the list will always be the content item within the provided Id.

Parameters:
id - the Id of the Content that should be treated as the root node for the load operation
con - the Connection to use to perform the load. Can be null.
bHeavy - a boolean value denoting whether a "heavy" load should be performed.
Throws:
KeyNotFoundException - if the provided content Id is invalid
PersistenceException - if some other error occurs while loading the object

loadByTocId

public Content loadByTocId(Id tocId)
                    throws KeyNotFoundException,
                           PersistenceException
Load the Content item that is the "Top" folder for the specified blackboard.data.navigation.CourseToc (identified by Id) in a lightweight fashion using a connection obtained through this object's database context.

The "Top" content object acts as an anchor for all of the Content within a course area (CourseToc) and is a ContentFolder which is the root parent of all other defined content items.

Parameters:
tocId - the Id of the blackboard.data.navigation.CourseToc for which the "Top" folder should be loaded
Throws:
KeyNotFoundException - if there is no CourseToc in the database with the given id
PersistenceException - if some other error occurs while loading the object

loadByTocId

public Content loadByTocId(Id tocId,
                           java.sql.Connection con)
                    throws KeyNotFoundException,
                           PersistenceException
Load the Content item that is the "Top" folder for the specified blackboard.data.navigation.CourseToc (identified by Id) in a lightweight fashion using the supplied connection.

The "Top" content object acts as an anchor for all of the Content within a course area (CourseToc) and is a ContentFolder which is the root parent of all other defined content items.

Parameters:
tocId - the Id of the blackboard.data.navigation.CourseToc for which the "Top" folder should be loaded
con - the Connection to use to perform the load. Can be null.
Throws:
KeyNotFoundException - if there is no CourseToc in the database with the given id
PersistenceException - if some other error occurs while loading the object

loadByTocId

public Content loadByTocId(Id tocId,
                           java.sql.Connection con,
                           boolean bDeep)
                    throws KeyNotFoundException,
                           PersistenceException
Load the Content item that is the "Top" folder for the specified blackboard.data.navigation.CourseToc (identified by Id) in a lightweight fashion using the supplied connection.

The "Top" content object acts as an anchor for all of the Content within a course area (CourseToc) and is a ContentFolder which is the root parent of all other defined content items.

If a deep load is requested, all descendants of the "Top" content item will also be loaded such that the returned content item will be the root node in a content tree. If the requested load is not deep, only the "Top" content item will be loaded.

Parameters:
tocId - the Id of the blackboard.data.navigation.CourseToc for which the "Top" folder should be loaded
con - the Connection to use to perform the load. Can be null.
bDeep - a boolean value denoting whether a "deep" load should be performed.
Throws:
KeyNotFoundException - if there is no CourseToc in the database with the given id
PersistenceException - if some other error occurs while loading the object

loadContentPath

public BbList loadContentPath(Id id)
                       throws KeyNotFoundException,
                              PersistenceException
Loads a list of content items containing the specified Content item (identified by Id) along with all of its ancestors from the database in a lightweight fashion using a connection obtained through this object's database context.

This method differs from other load methods in that it loads items up the tree of content instead of down. In other words, given the Id of a leaf node content item (leaf node within the "tree" of content) this method will load all of the ancestors of the leaf node back up tree, all the way to the root node.

The order of content items within the returned list is "top-down". This means that the "top" (root) content node will appear first in the list, with each subsequent item being from one level down in the tree.

Parameters:
id - the Id of the Content for which a content path should be loaded
Throws:
KeyNotFoundException - if the provided Content Id is invalid
PersistenceException - if some other error occurs while loading the object

loadContentPath

public BbList loadContentPath(Id id,
                              java.sql.Connection con)
                       throws KeyNotFoundException,
                              PersistenceException
Loads a list of content items containing the specified Content item (identified by Id) along with all of its ancestors from the database in a lightweight fashion using a connection obtained through this object's database context.

This method differs from other load methods in that it loads items up the tree of content instead of down. In other words, given the Id of a leaf node content item (leaf node within the "tree" of content) this method will load all of the ancestors of the leaf node back up tree, all the way to the root node.

The order of content items within the returned list is "top-down". This means that the "top" (root) content node will appear first in the list, with each subsequent item being from one level down in the tree.

Parameters:
id - the Id of the Content for which a content path should be loaded
con - the Connection to use to perform the load. Can be null.
Throws:
KeyNotFoundException - if the provided Content Id is invalid
PersistenceException - if some other error occurs while loading the object

loadChildren

public BbList loadChildren(Id id)
                    throws KeyNotFoundException,
                           PersistenceException
Loads a list containing the immediate children of the specified Content item (identified by Id) from the database in a lightweight fashion using a connection obtained through this object's database context.

The order of content items is preserved in the returned list.

Parameters:
id - the Id of the Content for which the immediate children should be loaded
Throws:
KeyNotFoundException - if the provided Content Id is invalid
PersistenceException - if some other error occurs while loading the object

loadChildren

public BbList loadChildren(Id id,
                           java.sql.Connection con)
                    throws KeyNotFoundException,
                           PersistenceException
Loads a list containing the immediate children of the specified Content item (identified by Id) from the database in a lightweight fashion using a connection obtained through this object's database context.

The order of content items is preserved in the returned list.

Parameters:
id - the Id of the Content for which the immediate children should be loaded
con - the Connection to use to perform the load. Can be null.
Throws:
KeyNotFoundException - if the provided Content Id is invalid
PersistenceException - if some other error occurs while loading the object


Copyright © 2003 Blackboard, Inc. All Rights Reserved.