|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackboard.data.BbObject blackboard.data.content.Content
public class Content
The Content
class is the root of the content class hierarchy.
All content objects have Content
as a superclass. This object
contains the attributes shared by all pieces of content.
Programmatically, Content
is the data object that is stored in
specific areas of the course. It does not include "tool" data, such as
Announcements, Calendar Entries, or Discussion Board postings.
The built-in content types supported by the system (as identified in the user
interface) include Documents, Folders, Lessons, and Files.
Nested Class Summary | |
---|---|
static class |
Content.RenderType
Class to encapsulate the hints used by the renderers. |
Field Summary | |
---|---|
static DataType |
DATA_TYPE
|
static java.lang.String |
RESOURCE_BUNDLE
Resource bundle for this data object |
Fields inherited from class blackboard.data.BbObject |
---|
_bbAttributes |
Fields inherited from interface blackboard.data.Positionable |
---|
POS_UNDEFINED |
Constructor Summary | |
---|---|
Content()
Default constructor. |
Method Summary | |
---|---|
void |
addContentFile(ContentFile cf)
Adds a the specified ContentFile as an attachment to this object. |
boolean |
getAllowGuests()
Returns the allow guests flag for this piece of Content . |
boolean |
getAllowObservers()
Returns the allow observers flag for this piece of Content . |
FormattedText |
getBody()
Returns the body of this object as a FormattedText object. |
BbList |
getContentFiles()
Returns the list of ContentFile objects associated with the content
item. |
java.lang.String |
getContentHandler()
Returns the Content Handler handle associated with this content object. |
ContentStatus |
getContentStatus()
Returns the ContentStatus for this content item. |
Id |
getCourseId()
Returns the course Id associated with this piece of
Content . |
DataType |
getDataType()
Returns the DataType identifier for this object. |
java.util.Calendar |
getEndDate()
Returns the last date this content object will be available to students. |
boolean |
getIsAvailable()
Returns whether the piece of Content is available. |
boolean |
getIsDescribed()
Returns whether this Content contains meta-data. |
boolean |
getIsFolder()
Returns whether this piece of Content should be treated as a
folder of content, or as an actual content piece itself. |
boolean |
getIsFromCartridge()
Returns whether this piece of TrackedContent came from a course
cartridge. |
boolean |
getIsLesson()
Returns whether the underlying content represents a lesson. |
boolean |
getIsReviewable()
Returns whether this piece of Content is presently set
for review. |
boolean |
getIsSequential()
Indicates whether the object is a Lesson that requires its
contents to be displayed in a sequential fashion. |
boolean |
getIsTracked()
Returns whether this piece of TrackedContent is presently set
for access tracking. |
boolean |
getLaunchInNewWindow()
Indicates whether a link for this object should be launched in a new window. |
java.lang.String |
getOfflineName()
Returns the offline name associated with this Content . |
java.lang.String |
getOfflinePath()
Returns the offline path associated with this Content . |
Id |
getParentId()
Returns the parent Id associated with this piece of
Content . |
java.lang.String |
getPersistentTitle()
Returns the persistent title associated with this piece of Content . |
int |
getPosition()
Returns the position of this piece of Content within its parent
content item (folder). |
BbList |
getRemovedFiles()
Returns a list of the Id s of the files that have been removed from
this content object. |
Content.RenderType |
getRenderType()
Returns the RenderType for this piece of content. |
java.util.Calendar |
getStartDate()
Returns the Calendar that indicates the first date this object
is to be made available in the student view of a course. |
java.lang.String |
getTitle()
Returns the title associated with this piece of Content . |
java.lang.String |
getTitleColor()
Returns the title color associated with this piece of Content . |
java.lang.String |
getUrl()
Returns the URL associated with this ExternalLink . |
void |
printTree()
printTree |
void |
removeContentFile(ContentFile cf)
Removes the specified ContentFile object from this content
object. |
void |
removeContentFile(Id id)
Removes the specified ContentFile object from this object. |
void |
setAllowGuests(boolean bAllowGuests)
Sets the allow guests flag for this piece of Content . |
void |
setAllowObservers(boolean bAllowObservers)
Sets the allow observers flag for this piece of Content . |
void |
setBody(FormattedText text)
Sets the body of this object as a FormattedText object. |
void |
setContentHandler(java.lang.String handler)
Sets the content handler for this content object. |
void |
setCourseId(Id iCourseId)
Sets the course Id value for this piece of Content . |
void |
setEndDate(java.util.Calendar cal)
Sets the last date this object will be available to students. |
void |
setIsAvailable(boolean bIsAvailable)
Sets whether this piece of Content is available. |
void |
setIsDescribed(boolean bIsDescribed)
Sets whether this Content contains meta-data. |
void |
setIsFolder(boolean isFolder)
Sets whether this piece of Content should be treated as a
folder of content, or as an actual content piece itself. |
void |
setIsFromCartridge(boolean bIsFromCartridge)
Sets whether this piece of TrackedContent came from a course
cartridge. |
void |
setIsLesson(boolean isLesson)
Sets whether the underlying content represents a lesson. |
void |
setIsReviewable(boolean bIsReviewable)
Sets whether this piece of Content should be set for
review. |
void |
setIsSequential(boolean sequential)
Sets whether the object is a Lesson that requires its contents
to be displayed in a sequential fashion. |
void |
setIsTracked(boolean bIsTracked)
Sets whether this piece of TrackedContent should be set for
access tracking. |
void |
setLaunchInNewWindow(boolean newWindow)
Sets whether a link for this object should be launched in a new window. |
void |
setOfflineName(java.lang.String strOfflineName)
Sets the offline name associated with this Content . |
void |
setOfflinePath(java.lang.String strOfflinePath)
Sets the offline path associated with this Content . |
void |
setParentId(Id iParentId)
Sets the parent Id value for this piece of Content . |
void |
setPosition(int nPos)
Sets the position of this piece of Content within its parent
content item (folder). |
void |
setRenderType(Content.RenderType eRenderType)
Sets the RenderType for this piece of content. |
void |
setStartDate(java.util.Calendar cal)
Sets the first date that this content object will be available to students. |
void |
setTitle(java.lang.String strTitle)
Sets the title associated with this piece of Content . |
void |
setTitleColor(java.lang.String strTitleColor)
Sets the title color associated with this piece of Content . |
void |
setUrl(java.lang.String strUrl)
Sets the URL associated with this ExternalLink . |
static void |
traverseContent(ContentVisitor visitor,
Content item)
Recursively traverses folders and content according to the visitor pattern. |
void |
validate()
Validates the contents of this Content . |
Methods inherited from class blackboard.data.BbObject |
---|
clone, getBbAttributes, getCreatedDate, getId, getModifiedDate, persist, setCreatedDate, setId, setModifiedDate, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static DataType DATA_TYPE
public static final java.lang.String RESOURCE_BUNDLE
Constructor Detail |
---|
public Content()
Content
. Various sub-classes
of this object will over-ride the default attributes in this object.
setCourseId(Id)
. However, most of the other attributes should be
set in order for the object to be properly used in a course.
Aggregate
(such as ContentFolder
or Lesson
), or you must persist the object and associate
it with a CourseToc
object.
Method Detail |
---|
public Id getCourseId()
Id
associated with this piece of
Content
.
Id
value for this piece of contentpublic void setCourseId(Id iCourseId)
Id
value for this piece of Content
.
This id must come from a course that already exists, otherwise any attempt
to persist this object will fail.
iCourseId
- the course Id
value to use for this piece of contentpublic Id getParentId()
Id
associated with this piece of
Content
. If the Id
returned is not set (see Id.isSet()
then this piece of content has no parent.
Id
value for this piece of contentpublic void setParentId(Id iParentId)
Id
value for this piece of Content
.
This is typically called when this object is added to an Aggregate
object, such as ContentFolder
.
iParentId
must already exist, otherwise
problems may occur when attempting to persist this object.
iParentId
- the parent Id
value to use for this piece of
contentpublic java.lang.String getPersistentTitle()
Content
.
String
public java.lang.String getTitle()
Content
.
String
public void setTitle(java.lang.String strTitle)
Content
. This
attribute can not exceed 255 characters.
strTitle
- a String
containing the title for this piec of
contentpublic FormattedText getBody()
FormattedText
object.
FormattedText
object.public void setBody(FormattedText text)
FormattedText
object. There
is no limit for the text component's size.
text
- the text to set.public java.lang.String getTitleColor()
Content
.
Color values should by a RGB color value as used in HTML pages (#RRGGBB --
for example, #000000 will display black).
String
public void setTitleColor(java.lang.String strTitleColor)
Content
.
This value can not exceed 10 characters.
strTitleColor
- a String
containing the title color for this
piece of content. The color value should by a RGB color value as
used in HTML pages (#RRGGBB -- for example, #000000 will display
black).public boolean getIsAvailable()
Content
is available.
getIsAvailable
in interface Available
public void setIsAvailable(boolean bIsAvailable)
Content
is available.
setIsAvailable
in interface Available
bIsAvailable
- true if this piece of content is available, false otherwisepublic boolean getIsFromCartridge()
TrackedContent
came from a course
cartridge.
public void setIsFromCartridge(boolean bIsFromCartridge)
TrackedContent
came from a course
cartridge.
bIsFromCartridge
- true if this piece of content came from a cartridge,
false otherwisepublic boolean getIsTracked()
TrackedContent
is presently set
for access tracking.
public void setIsTracked(boolean bIsTracked)
TrackedContent
should be set for
access tracking.
bIsTracked
- true if access to this piece of content should be tracked,
false otherwisepublic boolean getIsReviewable()
Content
is presently set
for review.
public void setIsReviewable(boolean bIsReviewable)
Content
should be set for
review.
bIsReviewable
- true if this piece of content can be reviewed,
false otherwisepublic boolean getIsDescribed()
Content
contains meta-data.
public void setIsDescribed(boolean bIsDescribed)
Content
contains meta-data.
bIsDescribed
- true if this course document has associated meta-data,
false otherwisepublic java.lang.String getOfflineName()
Content
.
String
public void setOfflineName(java.lang.String strOfflineName)
Content
.
strOfflineName
- a String
containing the offline name value
for this course documentpublic java.lang.String getOfflinePath()
Content
.
String
public void setOfflinePath(java.lang.String strOfflinePath)
Content
.
strOfflinePath
- a String
containing the offline path value
for this course documentpublic int getPosition()
Content
within its parent
content item (folder). This position should be used when displaying content
at the same level (parent-child wise) relative to each other. Position values
are zero-based (the first element has a position value of zero, not one).
A value of -1 indicates the new content
item will be appended
to the end of the list of items in the current folder.
getPosition
in interface Positionable
Positionable.POS_UNDEFINED
.public void setPosition(int nPos)
Content
within its parent
content item (folder). Position values are zero-based (the first element
has a position value of zero, not one).
The default value is -1, which indicates the new content
item will be appended to the end of the list of items in the current folder.
setPosition
in interface Positionable
nPos
- the new position value of this piece of content. This value
should be a positive value.public boolean getIsFolder()
Content
should be treated as a
folder of content, or as an actual content piece itself.
public void setIsFolder(boolean isFolder)
Content
should be treated as a
folder of content, or as an actual content piece itself. Most content sub-
classes willset this attribute automatically. Manually setting this attribute
should only be done when the final type of the content object is not known
when the object is instantiated.
isFolder
- indicate whether to treat this object as a folder.public boolean getIsLesson()
Content
.
true
if the object is a Lesson
public void setIsLesson(boolean isLesson)
Content
.
true
- if the object is a Lesson
public boolean getIsSequential()
Lesson
that requires its
contents to be displayed in a sequential fashion.
true
if the object requires its contents displayed in
linear order.public void setIsSequential(boolean sequential)
Lesson
that requires its contents
to be displayed in a sequential fashion. This property is typically set by specific sub-classes.
sequential
- if true
, the contents should be displayed in a linear order.public boolean getLaunchInNewWindow()
true
if the object is meant to be displayed in a new
rendering context (window)public void setLaunchInNewWindow(boolean newWindow)
newWindow
- true
if the object is meant to be displayed
in a new rendering context (window)public java.lang.String getUrl()
ExternalLink
.
String
public void setUrl(java.lang.String strUrl)
ExternalLink
. This field
cannot exceed 1024 characters. Additionally, it is not required to conform
to URL syntax, and is not double checked for "live" links.
strUrl
- a String
containing the url for this external linkpublic boolean getAllowGuests()
Content
. This
flag determines whether or not "guests" (users with the role guest) are
allowed access to this piece of content.
public void setAllowGuests(boolean bAllowGuests)
Content
. This flag
determines whether or not "guests" (users with the role guest) are allowed
access to this piece of content.
bAllowGuests
- true if guests should be allowed to this piece of content,
false otherwisepublic boolean getAllowObservers()
Content
.
This flag determines whether or not "observers" (parents of a student in a
course for example) are allowed access to this piece of content.
public void setAllowObservers(boolean bAllowObservers)
Content
. This
flag determines whether or not "observers" (parents of a student in a course
for example) are allowed access to this piece of content.
bAllowObservers
- true if observers should be allowed access to the
this piece of content, false otherwisepublic java.util.Calendar getStartDate()
Calendar
that indicates the first date this object
is to be made available in the student view of a course.
Note: the database's precision may affect the value retrieved from the database. Some databases store date/time values with precision only to the second, others store it to the millisecond.
Calendar
object. If this is a new object, or the value
was never set, null
will be returned.public void setStartDate(java.util.Calendar cal)
Note: the database's precision may affect the value stored in the database. Some databases store date/time values with precision only to the second, others store it to the millisecond.
cal
- Calendar object.public java.util.Calendar getEndDate()
Note: the database's precision may affect the value retrieved from the database. Some databases store date/time values with precision only to the second, others store it to the millisecond.
null
will be returned.public void setEndDate(java.util.Calendar cal)
Note: the database's precision may affect the value stored in the database. Some databases store date/time values with precision only to the second, others store it to the millisecond.
cal
- final datepublic Content.RenderType getRenderType()
RenderType
for this piece of content. This property
should be treated as a readonly property - it is typically determined by the
actual content type.
Content.RenderType
public void setRenderType(Content.RenderType eRenderType)
RenderType
for this piece of content. Since the value
of this property is determined by the actual content type, it should be
treated as a read only property as changing it value to an improper one
could cause rendering issues.
eRenderType
- a valid type value as defined in Course.RenderType
public java.lang.String getContentHandler()
public void setContentHandler(java.lang.String handler)
Content
subclasses or by business
logic (such as import/export) that needs to ensure the content data is
associated with a specific handler. System extensions, however, will set
this to ensure that content is handled (created, modified) by the code
installed with the system extension.
resource/x-bb-document
- Document
resource/x-bb-folder
- Folder
resource/x-bb-lesson
- Learning Unit
resource/x-bb-externallink
- External Link
resource/x-bb-courselink
- Course Link
resource/x-bb-file
- File (as used in a Learning Unit)
ContentHandlerStrings
interface.
handler
- handle string. The corresponding content handler does not
have to exist on the system. This parameter should not exceed 64
characters.public ContentStatus getContentStatus()
userId
parameter.
null
if Content was not retrieved with
an appropriate load method.public void addContentFile(ContentFile cf)
ContentFile
as an attachment to this object.
Note that in the UI, only Content
objects and ContentFileRef
objects require attachments.
Content
object has associated files for storing data, etc., but do not require those
files to be rendered in the default folder view, ContentFile
objects should not be use. Instead, the files should simply be manipulated
directly.
cf
- the ContentFile
to attachpublic BbList getRemovedFiles()
Id
s of the files that have been removed from
this content object.
BbList
of Id
objects. Each Id
in the list
represents the id of ContentFile
that was removed from this
content item.public void removeContentFile(ContentFile cf)
ContentFile
object from this content
object.
cf
- the ContentFile
to remove.public void removeContentFile(Id id)
ContentFile
object from this object.
id
- the Id
of the file to remove.public BbList getContentFiles()
ContentFile
objects associated with the content
item.
BbList
of the associated ContentFile
objects. The
list will be empty if there are no attachments.public static final void traverseContent(ContentVisitor visitor, Content item)
public final void printTree()
public DataType getDataType()
DataType
identifier for this object. Can be used to
uniquely identify the "type" of this data object.
getDataType
in interface IBbObject
getDataType
in class BbObject
DataType
for this objectpublic void validate() throws ValidationException
Content
. Internal consistency
checks are also performed.
validate
in interface IBbObject
validate
in class BbObject
ValidationException
- if validation of this object fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |