Oracle Collaboration Suite Discussions Java API Reference
10g (10.1.1)

Part No. B16232-01


oracle.discussions.sdk
Class TdBoard

java.lang.Object
  extended byjavax.mail.Folder
      extended byoracle.mail.sdk.esmail.OracleFolder
          extended byoracle.mail.sdk.esmail.OracleSharedFolder
              extended byoracle.discussions.sdk.TdContainer
                  extended byoracle.discussions.sdk.TdBoard

All Implemented Interfaces:
TdFavorite, javax.mail.UIDFolder
Direct Known Subclasses:
TdAnnouncementsBoard

public class TdBoard
extends TdContainer

This class represents a Board for holding messages. Board can only contain messages.

Oracle discussions elements names have been changed in the webui compared to that of sdk portion. The existing names to the new names mapping is as shown.

Since:
OCS 10.1.1

Nested Class Summary

Nested classes inherited from class oracle.mail.sdk.esmail.OracleFolder
oracle.mail.sdk.esmail.OracleFolder.OracleFlag

Nested classes inherited from class javax.mail.UIDFolder
javax.mail.UIDFolder.FetchProfileItem

Field Summary

Fields inherited from class oracle.discussions.sdk.TdContainer
TD_BOARD, TD_FACILITY

Fields inherited from class javax.mail.Folder
HOLDS_FOLDERS, HOLDS_MESSAGES, READ_ONLY, READ_WRITE

Fields inherited from interface javax.mail.UIDFolder
LASTUID

Constructor Summary
TdBoard(oracle.mail.sdk.esmail.OracleStore admstore, oracle.mail.sdk.esmail.OracleStore usrstore, oracle.discussions.sdk.impl.TdSession tdsession, java.lang.String folderName, long lFolderId, java.lang.String nameSpace)
Constructor to build a tdboard instance.

Method Summary
TdMessage appendMessage(javax.mail.Message mm)
Appends the supplied messages to this Board.
void convertUserFlag(javax.mail.Flags flags, long lUsrFlags)
Converts user flags as per the long flags number passed.
javax.mail.internet.MimeMessage createMessageForEdit(TdMessage msgOrig)
Replicates the original message for editing purpose.
javax.mail.internet.MimeMessage createMessageReply(TdMessage msgOrig)
Creates a message for the reply of the supplied one.
javax.mail.internet.MimeMessage createMessageReply(TdMessage msgOrig, boolean htmlContentType)
Creates a message for the reply of the supplied one.
javax.mail.internet.MimeMessage createMessageReply(TdMessage msgOrig, boolean htmlContentType, java.util.Locale loc, java.util.TimeZone tz)
Creates a message for the reply of the supplied one.
javax.mail.internet.MimeMessage createMessageTopic()
Creates a message for a new topic under this board.
javax.mail.internet.MimeMessage createMessageTopic(java.util.Locale loc)
Creates a message for a new topic under this board.
void delete()
Deletes this TdFacility in this message store - child facilities boards and messages will be deleted too.
TdMessage editMessage(TdMessage origMsg, javax.mail.Message mm)
Edits the given message and rturns back the edited message.
void eraseMessages(TdMessage[] msgs)
Erases the messages from the current board.
TdBoardSettings getBoardSettings()
Returns the settings of the board.
int getContainerType()
Returns the container type.
TdLastPost getLastPost()
Returns information on the last message posted to this board.
int getMessageCount()
Returns the count of messages in the board.
int getNewMessageCount()
Returns the count of the new messages in the board.
TdThread getThread(int iThreadId)
Returns the Thread from the current board, given its ID.
int getThreadCount()
Returns the count of threads in the board.
TdIterator getThreads()
Returns the list of message threads available in this board.
TdIterator getThreads(int iFetchStart, boolean bSortByCreation, boolean bAscending)
Returns the list of message threads available in this board.
int getUnreadMessageCount()
Returns the number of messages which are unread in the board.
void grantBoardModerator(TdUser tdUser)
Grants Board Moderator role to the supplied user for this board.
void grantBoardReader(TdUser tdUser)
Grants Board Reader role to the supplied user for this board.
void grantBoardWriter(TdUser tdUser)
Grants Board Writer role to the supplied user for this board.
boolean hasNewMessages()
Returns a boolean value indicating if the board has new messages.
boolean isLocked()
Returns the boolean status indicating if the board is locked.
boolean isPublic()
Returns a boolean value indicating if the board is public.
void lock()
Locks the oracle discussions board.
void revokeBoardModerator(TdUser tdUser)
Revokes Board Moderator role to the supplied user for this board.
void revokeBoardReader(TdUser tdUser)
Revokes Board Reader role to the supplied user for this board.
void revokeBoardWriter(TdUser tdUser)
Revokes Board Writer role to the supplied user for this board.
void unlock()
Unlocks the oracle discussions board.

Methods inherited from class oracle.discussions.sdk.TdContainer
addACI, addACI, addACI, addACI, addToFavorites, appendMessages, appendMessages, close, copyMessages, create, delete, equals, exists, expunge, fetch, getAnnouncementsBoard, getContainer, getContainerSettings, getCreationDate, getCreator, getDescription, getDisplayFullPathUsingDisplayName, getDisplayName, getFavoriteThreads, getFilteredHeaders, getFlags, getFolder, getGranteeACI, getLastMessagePosts, getMessage, getMessageByType, getMessageByUID, getMessages, getMessages, getMessages, getMessagesByUID, getMessagesByUID, getParent, getParentFacility, getPermanentFlags, getPermissions, getPopularThreads, getTdUser, getUID, getUIDValidity, hasAnnouncementsBoard, hasRead, hasWrite, isFavorite, isGuest, isNew, isNewSinceLastVisit, isNewSinceSession, isOpen, isShared, isSubscribed, list, list, list, list, listGranteeRoles, listSubscribed, modifyACI, modifyACI, moveMessages, open, openInternal, removeACI, removeACI, removeFromFavorites, renameTo, search, search, search, search, setFlags, setFlags, setFlags, setSubscribed, sortMessages, updateContainerSettings, updateGranteeRoles

Methods inherited from class oracle.mail.sdk.esmail.OracleSharedFolder
_setFlags, getNamespace, hasDigitPermission

Methods inherited from class oracle.mail.sdk.esmail.OracleFolder
_doSearch, addACI, addACI, appendMessages, convertFlag, convertFlag, convertUsrFlag, getCounts, getFolderExpiry, getFolderId, getFolderSize, getFolderSize, getFullName, getFullPath, getName, getSeparator, getType, getURLName, isInheritedACI, removeACI, removeACI, setFolderExpiry

Methods inherited from class javax.mail.Folder
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, getDeletedMessageCount, getMode, getStore, listSubscribed, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, toString

Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TdBoard

public TdBoard(oracle.mail.sdk.esmail.OracleStore admstore,
               oracle.mail.sdk.esmail.OracleStore usrstore,
               oracle.discussions.sdk.impl.TdSession tdsession,
               java.lang.String folderName,
               long lFolderId,
               java.lang.String nameSpace)
Constructor to build a tdboard instance.
Parameters:
admstore - Oracle email administrator store
usrstore - Oracle email User store
tdsession - oracle discussions session
folderName - name of the board to be created.
lFolderId - long folder identifier indicating the shared folder.

Method Detail

getContainerType

public int getContainerType()
Returns the container type.

Returns TdContainer.TD_BOARD.

Specified by:
getContainerType in class TdContainer
Returns:
int integer representing the container type.

getLastPost

public TdLastPost getLastPost()
                       throws TdException
Returns information on the last message posted to this board.
Overrides:
getLastPost in class TdContainer
Returns:
TdLastPost
Throws:
TdException

grantBoardModerator

public void grantBoardModerator(TdUser tdUser)
                         throws TdException
Grants Board Moderator role to the supplied user for this board.
Parameters:
tdUser - oracle discussions user to whom the role is to be granted.
Throws:
TdException

isPublic

public boolean isPublic()
                 throws TdException
Returns a boolean value indicating if the board is public.

Returns true if the board is public and false otherwise.

Returns:
boolean value indicating if the board is public
Throws:
TdException

grantBoardReader

public void grantBoardReader(TdUser tdUser)
                      throws TdException
Grants Board Reader role to the supplied user for this board.
Parameters:
tdUser - user to whom board reader permissions is to be granted.
Throws:
TdException

grantBoardWriter

public void grantBoardWriter(TdUser tdUser)
                      throws TdException
Grants Board Writer role to the supplied user for this board.
Throws:
TdException

revokeBoardModerator

public void revokeBoardModerator(TdUser tdUser)
                          throws TdException
Revokes Board Moderator role to the supplied user for this board.
Parameters:
tdUser - user from whom board moderator role is being revoked.
Throws:
TdException

revokeBoardReader

public void revokeBoardReader(TdUser tdUser)
                       throws TdException
Revokes Board Reader role to the supplied user for this board.
Parameters:
tdUser - user from whom board rader role is being revoked from
Throws:
TdException

revokeBoardWriter

public void revokeBoardWriter(TdUser tdUser)
                       throws TdException
Revokes Board Writer role to the supplied user for this board.
Parameters:
tdUser - discussions user from whom board writer role is being revoked
Throws:
TdException

createMessageTopic

public javax.mail.internet.MimeMessage createMessageTopic()
                                                   throws TdException
Creates a message for a new topic under this board.

The returned message is NOT appended to the board. The returned message will be initialized according to the board settings and teh connect user:

Returns:
MimeMessage
Throws:
TdException

createMessageTopic

public javax.mail.internet.MimeMessage createMessageTopic(java.util.Locale loc)
                                                   throws TdException
Creates a message for a new topic under this board.

The returned message is NOT appended to the board. The returned message will be initialized according to the board settings and teh connect user:

Parameters:
loc - locale information to be used to format the author name
Returns:
MimeMessage
Throws:
TdException

createMessageReply

public javax.mail.internet.MimeMessage createMessageReply(TdMessage msgOrig)
                                                   throws TdException,
                                                          javax.mail.MessagingException
Creates a message for the reply of the supplied one.

The returned message is NOT appended to the board. The returned message will be initialized according to the board settings:

.
Furthermore, the content type of the MimeMessage returned will be "text/html.".
Parameters:
msgOrig - original message to which reply is to be created
Returns:
MimeMessage
Throws:
TdException
javax.mail.MessagingException

createMessageReply

public javax.mail.internet.MimeMessage createMessageReply(TdMessage msgOrig,
                                                          boolean htmlContentType)
                                                   throws TdException,
                                                          javax.mail.MessagingException
Creates a message for the reply of the supplied one.

The returned message is NOT appended to the board. The returned message will be initialized according to the board settings:

.
Furthermore, the content type of the MimeMessage returned will be determined by the @param htmlContentType parameter.
If this parameter is set to true, the content type will be "text/html". Otherwise, it will be set to "text/plain".
Parameters:
msgOrig - original message to which reply is to be created
htmlContentType - content type used in creating the message.
Returns:
MimeMessage
Throws:
TdException
javax.mail.MessagingException

createMessageReply

public javax.mail.internet.MimeMessage createMessageReply(TdMessage msgOrig,
                                                          boolean htmlContentType,
                                                          java.util.Locale loc,
                                                          java.util.TimeZone tz)
                                                   throws TdException,
                                                          javax.mail.MessagingException
Creates a message for the reply of the supplied one.

The returned message is NOT appended to the board. The returned message will be initialized according to the board settings:


Furthermore, the content type of the MimeMessage returned will be determined by the @param htmlContentType parameter.
If this parameter is set to true, the content type will be "text/html". Otherwise, it will be set to "text/plain".
Parameters:
msgOrig - original message to which reply is to be created
htmlContentType - content type to be used in the reply
loc - locale information to be used to format the reply.
tz - the time zone to be used to format the reply prefix
Returns:
MimeMessage
Throws:
TdException
javax.mail.MessagingException

createMessageForEdit

public javax.mail.internet.MimeMessage createMessageForEdit(TdMessage msgOrig)
                                                     throws TdException,
                                                            javax.mail.MessagingException
Replicates the original message for editing purpose.
Parameters:
msgOrig - Original message to be edited
Returns:
MimeMessage the message returned
Throws:
TdException
javax.mail.MessagingException

editMessage

public TdMessage editMessage(TdMessage origMsg,
                             javax.mail.Message mm)
                      throws TdException,
                             javax.mail.MessagingException
Edits the given message and rturns back the edited message.
Parameters:
origMsg - original message to be edited
Returns:
TdMessage
Throws:
TdException
javax.mail.MessagingException

appendMessage

public TdMessage appendMessage(javax.mail.Message mm)
                        throws TdException,
                               javax.mail.MessagingException
Appends the supplied messages to this Board.
Parameters:
mm - message to be appended
Returns:
TdMessage, the appended message along with the original message
Throws:
TdException
messagingException
javax.mail.MessagingException

getBoardSettings

public TdBoardSettings getBoardSettings()
                                 throws TdException
Returns the settings of the board. Board settings include information like:
and other settings.
Returns:
TdBoardSettings
Throws:
TdException

eraseMessages

public void eraseMessages(TdMessage[] msgs)
                   throws javax.mail.MessagingException,
                          TdException
Erases the messages from the current board.
Throws:
javax.mail.MessagingException
TdException

getThreadCount

public int getThreadCount()
                   throws TdException
Returns the count of threads in the board.
Returns:
int integer indicating the thread count
Throws:
javax.mail.MessagingException
TdException

getMessageCount

public int getMessageCount()
                    throws javax.mail.MessagingException
Returns the count of messages in the board.
Returns:
int integer indicating the message count
Throws:
javax.mail.MessagingException

getNewMessageCount

public int getNewMessageCount()
                       throws javax.mail.MessagingException
Returns the count of the new messages in the board.

A message is considered as new if the user hasnot already read the same.

Returns:
int integer indicating the new message count
Throws:
javax.mail.MessagingException

hasNewMessages

public boolean hasNewMessages()
                       throws javax.mail.MessagingException
Returns a boolean value indicating if the board has new messages.

A message is considered as new if the user hasnot already read the same.
Returns true is the message is new and false otherwise.

Returns:
boolean condition indicating if the message is new or not
Throws:
javax.mail.MessagingException

getThread

public TdThread getThread(int iThreadId)
                   throws TdException,
                          javax.mail.MessagingException
Returns the Thread from the current board, given its ID.
Parameters:
iThreadId - the thread id indicating thread retrieved
Returns:
TdThread
Throws:
TdException
javax.mail.MessagingException

getThreads

public TdIterator getThreads()
                      throws TdException
Returns the list of message threads available in this board.

TdThread objects are light-weight references to the actual message that started the thread. In addition to the message id of the thread in this call thread information such # of messages in the Thread and last post information (date, author) will be retrieved too. To fill up additional thread details call fetch.
By default threads will be sorted by last post date in descending order.

Returns:
TdIterator
Throws:
TdException

getThreads

public TdIterator getThreads(int iFetchStart,
                             boolean bSortByCreation,
                             boolean bAscending)
                      throws TdException
Returns the list of message threads available in this board.

TdThread objects are light-weight references to the actual message that started the thread. In addition to the message id of the thread in this call thread information such # of messages in the Thread and last post information (date, author) will be retrieved too.
To fill up additional thread details call fetch. Limiting Sorting options can be specified too.
By default threads will be sorted by last post date in descending order.

TODO: create or re-use some sorting criteria class.
Parameters:
iFetchStart - number of threads to be fetched.
bSortByCreation - boolean condition indicating if the threads are to be sorted by creation time
Returns:
TdIterator
Throws:
TdException

getUnreadMessageCount

public int getUnreadMessageCount()
                          throws javax.mail.MessagingException
Returns the number of messages which are unread in the board. A message is considered as unread if it is not opened.
Throws:
javax.mail.MessagingException

lock

public void lock()
          throws TdException
Locks the oracle discussions board. User invkoing this operation should have a role equivalent to the board moderator or higher to be able to edit the board.
Throws:
TdException

unlock

public void unlock()
            throws TdException
Unlocks the oracle discussions board. User invkoing this operation should have a role equivalent to the board moderator or higher to be able to edit the board.
Throws:
TdException

isLocked

public boolean isLocked()
                 throws TdException
Returns the boolean status indicating if the board is locked.

Returns true if the board is locked, false otherwise.

Returns:
boolean boolean condition indicating if the board is locked.
Throws:
TdException - generic oracle discussions exception thrown while trying to lock the board.

delete

public void delete()
            throws TdException
Deletes this TdFacility in this message store - child facilities boards and messages will be deleted too. After this method is called the TdFacility instance should be used anymore as it can lead to unpredictable results.
Specified by:
delete in class TdContainer
Throws:
TdException - exception thrown when trying to delete the board.
See Also:
oracle.discussions.sdk.TdStore#deleteFacility

convertUserFlag

public void convertUserFlag(javax.mail.Flags flags,
                            long lUsrFlags)
                     throws javax.mail.MessagingException
Converts user flags as per the long flags number passed.

Checks in the array of glags if all the flags are set, if not, sets the same.

Parameters:
flags - The flags that are set
lUsrFlags - long value which is used in comparing ans setting the flags.
Throws:
javax.mail.MessagingException

Copyright © 2005, Oracle. All rights reserved.