|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectblackboard.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.ContentView
Defines the intended Default Content View set for this Course. |
static class |
Content.RenderType
Class to encapsulate the hints used by the renderers. |
| Field Summary | |
|---|---|
static java.lang.String |
COURSELINK_HANDLER
|
static DataType |
DATA_TYPE
|
static java.lang.String |
ICON_URL
|
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 without any pre 9.0 assignment internal artifact |
BbList<ContentFile> |
getContentFiles()
|
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. |
ExtendedData |
getExtendedData()
Retrieves the ExtendedData object for this entity. |
blackboard.platform.gradebook2.GradableItem |
getGradebookItem()
|
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 |
getIsGroupContent()
Returns whether the piece of Content is a content associated with a course group. |
boolean |
getIsLesson()
Returns whether the underlying content represents a lesson. |
boolean |
getIsReviewable()
Returns whether this piece of Content is presently set for
review. |
boolean |
getIsSampleContent()
Indicates whether the object is a piece of sample content that was imported as part of a course structure. |
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 |
getLinkRef()
Returns the optional LinkRef associated with this Content. |
java.lang.String |
getLinkTargetIconUrl()
Return the icon url of the linked item either from cache or database in case this is a course link. |
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<Id> |
getRemovedFiles()
|
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. |
java.lang.String |
getUrlHost()
Returns the hostname from the URL associated with this item. |
Content.ContentView |
getViewMode()
Returns the ViewMode associated with this Content. |
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. |
static java.lang.String |
removeInternalArtifacts(java.lang.String bodyText)
|
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 |
setContentStatus(ContentStatus status)
Sets the content status for this item (only used for display purposes will not be persisted by ContentDbPersister) |
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 |
setExtendedData(ExtendedData ed)
Sets the ExtendedData element for this entity. |
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 |
setIsGroupContent(boolean bIsGroupContent)
Sets whether this piece of Content is a content associated with a course group. |
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 |
setIsSampleContent(boolean sampleContent)
Sets whether the object is a piece of sample content that was imported as part of a course structure. |
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 |
setLinkRef(java.lang.String strLinkRef)
Sets the optional LinkRef associated with this Content. |
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. |
void |
setViewMode(Content.ContentView eViewContent)
Sets the ViewMode associated with this Content. |
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, matches, 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 final DataType DATA_TYPE
public static final java.lang.String RESOURCE_BUNDLE
public static final java.lang.String ICON_URL
public static final java.lang.String COURSELINK_HANDLER
| 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.
Stringpublic java.lang.String getTitle()
Content.
Stringpublic void setTitle(java.lang.String strTitle)
Content. This attribute can not exceed 333 characters.
strTitle - a String containing the title for this piece of contentpublic FormattedText getBody()
FormattedText object without any pre 9.0 assignment internal artifact
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).
Stringpublic 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 Availablepublic void setIsAvailable(boolean bIsAvailable)
Content is available.
(Setting with bIsAvailable=true will also set the sample_content_ind to false)
setIsAvailable in interface AvailablebIsAvailable - true if this piece of content is available, false otherwisepublic void setIsGroupContent(boolean bIsGroupContent)
Content is a content associated with a course group.
bIsGroupContent - true if this piece of content is available, false otherwisepublic boolean getIsGroupContent()
Content is a content associated with a course group.
public Content.ContentView getViewMode()
Content.
Content.ContentViewpublic void setViewMode(Content.ContentView eViewContent)
Content.
eViewContent - the view mode value for this course documentpublic boolean getIsFromCartridge()
TrackedContent came from a
course cartridge.
public void setIsFromCartridge(boolean bIsFromCartridge)
TrackedContent came from a course cartridge.
(and more specifically - if it is protected/authorized content that should not be published/exported/etc.
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.
Stringpublic void setOfflineName(java.lang.String strOfflineName)
Content.
strOfflineName - a String containing the offline name value for this course documentpublic java.lang.String getOfflinePath()
Content.
Stringpublic 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 PositionablePositionable.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 PositionablenPos - 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 will set 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 Lessonpublic void setIsLesson(boolean isLesson)
Content.
isLesson - true if the object is a Lessonpublic 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.
Stringpublic java.lang.String getUrlHost()
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.RenderTypepublic 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 Content.RenderTypepublic 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)
ContentHandlerInfo enum.
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()
public void setContentStatus(ContentStatus status)
public java.lang.String getLinkRef()
Content.
Stringpublic void setLinkRef(java.lang.String strLinkRef)
Content. This field cannot exceed 255 characters. This
is used for a building block providers to set an identifying string on content they create that they can tie back
to data on their end.
strLinkRef - a String containing the LinkRef reference stringpublic java.lang.String getLinkTargetIconUrl()
public ExtendedData getExtendedData()
ExtendedData object for this entity. Extended data
is a simple mechanism for storing an arbitrary set of "properties" for an
entity. It can be used to store properties without extending an object's
data model or resorting to additional schema.
Care should be taken to use this capability wisely. There is a balance between the convenience of using this capability for a new value versus the drawbacks of a generally opaque and untyped container for values.
The use of extended data should not "leak" into business logic code.
Instead, extended data use should be completely wrapped by a bean object
that controls access to the data values in extended data. See ExtendedData for more information.
getExtendedData in interface HasExtendedDataExtendedData value contained within this entity.
This value will never be null. If a null value has been set for
this object a new (empty) extended data value will be returned.public void setExtendedData(ExtendedData ed)
HasExtendedDataExtendedData element for this entity. It should not
normally be necessary to set the extended data value directly. Instead,
you should retrieve the existing value and then set any necessary value(s)
on it. Setting extended data via this method may override existing values.
setExtendedData in interface HasExtendedDataed - the ExtendedData value to setpublic boolean getIsSampleContent()
true if the object was originally imported via a course structurepublic void setIsSampleContent(boolean sampleContent)
sampleContent - if true, the object will be displayed with an additional css to differentiate itpublic 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<Id> getRemovedFiles()
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<ContentFile> getContentFiles()
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 IBbObjectgetDataType in interface IdentifiablegetDataType in class BbObjectDataType for this object
public void validate()
throws ValidationException
Content. Internal consistency checks are also performed.
validate in interface IBbObjectvalidate in class BbObjectValidationException - if validation of this object failspublic blackboard.platform.gradebook2.GradableItem getGradebookItem()
public static java.lang.String removeInternalArtifacts(java.lang.String bodyText)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||