|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ContentDbLoader
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.
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 | |
---|---|
java.util.List |
loadAvailableChildren(Id folderId,
Id userId,
boolean heavy,
java.sql.Connection con)
Loads all children of the specified folder, honoring availability settings as determined for the specified user. |
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 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 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 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. |
java.util.List |
loadChildren(Id id,
boolean heavy,
java.sql.Connection con)
Loads a list containing the immediate children of the specified Content item (identified by Id) from the database using a connection obtained using the supplied Connection. |
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 using the supplied Connection. |
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 using the supplied Connection. |
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. |
java.util.List |
loadMapView(Id userId,
Id courseId,
java.sql.Connection con)
Returns a list of items representing the top-level content items in the course. |
java.util.List |
loadPathAndStatus(Id id,
Id userId,
java.sql.Connection con)
Method to return a path to a given item. |
java.util.List |
loadReviewableByCourseId(Id id)
Loads a list containing the all the Content items in the given course which have reviewable flag set to true. |
java.util.List |
loadReviewableByCourseId(Id id,
java.sql.Connection con)
Loads a list containing the all the Content items in the given course which have reviewable flag set to true. |
Methods inherited from interface blackboard.persist.Loader |
---|
getAppVersion, init |
Field Detail |
---|
static final java.lang.String TYPE
BbPersistenceManager.getLoader(String)
.
Method Detail |
---|
Content loadById(Id id) throws KeyNotFoundException, PersistenceException
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)
.
id
- the Id
of the Content
that should be loaded
KeyNotFoundException
- if there is no Content in the database with
the given id
PersistenceException
- if some other error occurs while loading
the objectContent loadById(Id id, java.sql.Connection con) throws KeyNotFoundException, PersistenceException
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)
.
id
- the Id
of the Content
that should be loadedcon
- the Connection
to use to perform the load. Can be null.
KeyNotFoundException
- if there is no Content in the database with
the given id
PersistenceException
- if some other error occurs while loading
the objectContent loadById(Id id, java.sql.Connection con, boolean bDeep, boolean bHeavy) throws KeyNotFoundException, PersistenceException
id
- the Id
of the Content
that should be loadedcon
- 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.
KeyNotFoundException
- if there is no Content in the database with
the given id
PersistenceException
- if some other error occurs while loading
the objectBbList loadListById(Id id) throws KeyNotFoundException, PersistenceException
id
- the Id
of the Content
that should be treated as
the root node for the load operation
KeyNotFoundException
- if the provided content Id is invalid
PersistenceException
- if some other error occurs while loading
the objectBbList loadListById(Id id, java.sql.Connection con) throws KeyNotFoundException, PersistenceException
id
- the Id
of the Content
that should be treated as
the root node for the load operationcon
- the Connection
to use to perform the load. Can be null.
KeyNotFoundException
- if the provided content Id is invalid
PersistenceException
- if some other error occurs while loading
the objectBbList loadListById(Id id, java.sql.Connection con, boolean bHeavy) throws KeyNotFoundException, PersistenceException
id
- the Id
of the Content
that should be treated as
the root node for the load operationcon
- the Connection
to use to perform the load. Can be null.bHeavy
- a boolean
value denoting whether a "heavy" load
should be performed.
KeyNotFoundException
- if the provided content Id is invalid
PersistenceException
- if some other error occurs while loading
the objectContent loadByTocId(Id tocId) throws KeyNotFoundException, PersistenceException
CourseToc
(identified by Id) in a lightweight
fashion using a connection obtained through this object's database context.
CourseToc
) and is a ContentFolder which is the
root parent of all other defined content items.
tocId
- the Id
of the CourseToc
for which the "Top" folder should be loaded
KeyNotFoundException
- if there is no CourseToc in the database with
the given id
PersistenceException
- if some other error occurs while loading
the objectContent loadByTocId(Id tocId, java.sql.Connection con) throws KeyNotFoundException, PersistenceException
CourseToc
(identified by Id) in a lightweight
fashion using the supplied connection.
CourseToc
) and is a ContentFolder which is the
root parent of all other defined content items.
tocId
- the Id
of the CourseToc
for which the "Top" folder should be loadedcon
- the Connection
to use to perform the load. Can be null.
KeyNotFoundException
- if there is no CourseToc in the database with
the given id
PersistenceException
- if some other error occurs while loading
the objectContent loadByTocId(Id tocId, java.sql.Connection con, boolean bDeep) throws KeyNotFoundException, PersistenceException
CourseToc
(identified by Id) in a lightweight
fashion using the supplied connection.
CourseToc
) and is a ContentFolder which is the
root parent of all other defined content items.
tocId
- the Id
of the CourseToc
for which the "Top" folder should be loadedcon
- the Connection
to use to perform the load. Can be null.bDeep
- a boolean
value denoting whether a "deep" load
should be performed.
KeyNotFoundException
- if there is no CourseToc in the database with
the given id
PersistenceException
- if some other error occurs while loading
the objectBbList loadContentPath(Id id) throws KeyNotFoundException, PersistenceException
id
- the Id
of the Content
for which a content path
should be loaded
KeyNotFoundException
- if the provided Content Id is invalid
PersistenceException
- if some other error occurs while loading
the objectBbList loadContentPath(Id id, java.sql.Connection con) throws KeyNotFoundException, PersistenceException
id
- the Id
of the Content
for which a content path
should be loadedcon
- the Connection
to use to perform the load. Can be null.
KeyNotFoundException
- if the provided Content Id is invalid
PersistenceException
- if some other error occurs while loading
the objectjava.util.List loadPathAndStatus(Id id, Id userId, java.sql.Connection con) throws PersistenceException
loadContentPath()
except that it 1) uses a filtered map (loading only title, id, isAvailable, and contentHandler)
and 2) attaches a status object each element in the path.
The principal use case for this method is loading a path to check whether an item is available based availability of parent objects (e.g., direct linking to a 4th level folder must be disallowed when the 1st level folder is unavailable).
id
- Id of the leaf itemuserId
- Id of the user for evaluating release rulescon
- Connection to query with
PersistenceException
- thrown if an error occurs during loadBbList loadChildren(Id id) throws KeyNotFoundException, PersistenceException
id
- the Id
of the Content
for which the immediate
children should be loaded
KeyNotFoundException
- if the provided Content Id is invalid
PersistenceException
- if some other error occurs while loading
the objectBbList loadChildren(Id id, java.sql.Connection con) throws KeyNotFoundException, PersistenceException
id
- the Id
of the Content
for which the immediate
children should be loadedcon
- the Connection
to use to perform the load. Can be null.
KeyNotFoundException
- This exception is currently not thrown, but included
for backwards-compatibility
PersistenceException
- if some other error occurs while loading
the objectjava.util.List loadChildren(Id id, boolean heavy, java.sql.Connection con) throws PersistenceException
heavy
flag.
id
- the Id
of the Content
for which the immediate
children should be loadedheavy
- Flag indicating whether to load attached files.con
- the Connection
to use to perform the load. Can be null.
KeyNotFoundException
- This exception is currently not thrown, but included
for backwards-compatibility
PersistenceException
- if some other error occurs while loading
the objectjava.util.List loadAvailableChildren(Id folderId, Id userId, boolean heavy, java.sql.Connection con) throws PersistenceException
folderId
- Id of the parent itemuserId
- Id of the user to checkheavy
- Flag whether to load associated files and attach them to the content
listcon
- Connection to perform query against. If null, a connection is retrieved
from the current context
heavy
is true, each item will have an attached
collection of ContentFile
objects.
PersistenceException
java.util.List loadMapView(Id userId, Id courseId, java.sql.Connection con) throws PersistenceException
Note: loadMapView()
loads a "filtered" view of the object, so
not all attributes are going to be available. Implementations of this method, at a minimum
must load the following attributes:
userId
- User id used for evaluating adaptive release rulescourseId
- Course to retrieve folders forcon
- Connection to query against. If null
, the default connection is used
PersistenceException
java.util.List loadReviewableByCourseId(Id id) throws KeyNotFoundException, PersistenceException
id
- the Id
of the Course
for which the reviewable
items should be loaded
PersistenceException
- if some other error occurs while loading
the object
KeyNotFoundException
java.util.List loadReviewableByCourseId(Id id, java.sql.Connection con) throws PersistenceException
id
- the Id
of the Course
for which the reviewable
items should be loadedcon
- the Connection
to use to perform the load. Can be null.
PersistenceException
- if some other error occurs while loading
the object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |