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

Part No. B16232-01


oracle.discussions.sdk
Class TdAnnouncementsBoard

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
                      extended byoracle.discussions.sdk.TdAnnouncementsBoard

All Implemented Interfaces:
TdFavorite, javax.mail.UIDFolder

public class TdAnnouncementsBoard
extends TdBoard

Announcements Board extends the conventional TdBoard class.

An announcement is any special thread which is intended to all the users of the board posted by either administrator or moderator. TdAnnouncementsBoard is a class, describing an anouncements board. An announcements board is a special board which is implicit. Only administrator and moderator will be able to post threads into an announcements board. It is always public, meaning that any user can read the contant posted to the board. Once created, an announcements board cannot be edited. The parents facility of the announcements board si always null and the announcements board cannot be locked just like any other board.

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.

Sample code snippet illustrating the usage of TdAnnouncmentsBoard.

 TdAnnouncementsBoard tdab = null;
 String annFullPath = null;
 try {
       annFullPath = AnnouncementsHandler.getAnnouncementsFolderName(null, _tdsession) // _tdsession is a TdSession object
       OracleFolder fAnn = (OracleFolder) AnnouncementsHandler.getAnnouncementsFolder(annFullPath, _tdsession);
       String  namespace = _tdsession.getAdminNamespace();
          String folderName = annFullPath.substring(namespac.length() + 1);
          tdab = new TdAnnouncementsBoard(_tdsession.getAdminStore(), _tdsession.getAdminStore(), _tdsession,
                                        folderName, fAnn.getFolderId(), namespace);
 }
 catch(Exception e)
 {} 
 
Since:
OCS 10.1.1
See Also:
TdBoard.java

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
TdAnnouncementsBoard(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.

Method Summary
void addToFavorites()
Adds the board to the list of favorites.
void delete()
Deletes the board.
TdBoard getAnnouncementsBoard()
Returns the announcements board.
java.lang.String getDisplayName()
Returns board display name.
TdFacility getParentFacility()
Returns the parent container which holds the board.
TdThread getThread(int iThreadId)
Returns a particular thread in the board given its Thread ID.
TdIterator getThreads(int iFetchStart, boolean bSortByCreation, boolean bAscending)
Returns a thread iterator comprising of threads in the announcements board.
void grantBoardModerator(TdUser tdUser)
Grants Board Moderator role to the user passed.
void grantBoardReader(TdUser tdUser)
Grants Board Reader role to the user passed.
void grantBoardWriter(TdUser tdUser)
Grants Board Writer role to the user passed.
boolean isFavorite()
Returns if the board is marked as a favorite container.
boolean isLocked()
Returns a boolean status indicating is the board is locked.
boolean isPublic()
Returns if the board is marked for the public access.
void lock()
Tries to lock the board so that only moderator and administrator can write to the board.
void markPublic(boolean bPublic)
Marks the board for public access.
void removeFromFavorites()
Removes the board from list of favorites.
void revokeBoardModerator(TdUser tdUser)
Revokes Board Moderator role from the user passed.
void revokeBoardReader(TdUser tdUser)
Revokes Board Reader role from the user passed.
void revokeBoardWriter(TdUser tdUser)
Revokes Board Writer role from the user passed.
void setDescription(java.lang.String description)
Sets the description for the board.
void unlock()
Unlocks the Board so that the board writers can post messages to the board.
void updateContainerSettings(TdContainerSettings tdCntSettings)
Updates the board settings with the settings object passed.
void updateGranteeRoles(java.util.List lstOfRoles)
Updates the user roles from the list of roles passed as the argument.

Methods inherited from class oracle.discussions.sdk.TdBoard
appendMessage, convertUserFlag, createMessageForEdit, createMessageReply, createMessageReply, createMessageReply, createMessageTopic, createMessageTopic, editMessage, eraseMessages, getBoardSettings, getContainerType, getLastPost, getMessageCount, getNewMessageCount, getThreadCount, getThreads, getUnreadMessageCount, hasNewMessages

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

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

TdAnnouncementsBoard

public TdAnnouncementsBoard(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. Creates an instance of the TdAnnouncementsBoard given user, admin stores, TdSession object, the container/folder name, folder if and namespace.
Parameters:
admstore - Oracle Email Admin Store for shared folders
usrstore - Oracle Email User Store for shared folder storage
tdsession - Threaded Discussions Session Object for this td instance
folderName - Shared Folder Name
lFolderId - The Shared Folder ID
See Also:
TdBoard

Method Detail

grantBoardModerator

public void grantBoardModerator(TdUser tdUser)
                         throws TdException
Grants Board Moderator role to the user passed.

Grants Board Moderator role to the user passed to it. Once the board moderator role is granted to the user, he will be able to post announcements into the board. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited.

Overrides:
grantBoardModerator in class TdBoard
Parameters:
tdUser - a Threaded Discussions user to whom the board moderator role is to be granted
Throws:
TdException - A generic threaded discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.

grantBoardReader

public void grantBoardReader(TdUser tdUser)
                      throws TdException
Grants Board Reader role to the user passed.

Grants Board Reader role to the user passed to it. Once the user is a board reader, he will be able to read the threads, messages in that board. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited.

Overrides:
grantBoardReader in class TdBoard
Parameters:
tdUser - a Threaded Discussions user to whom the board moderator role is to be granted
Throws:
TdException - A generic threaded discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.

grantBoardWriter

public void grantBoardWriter(TdUser tdUser)
                      throws TdException
Grants Board Writer role to the user passed.

Grants Board Writer role to the user passed to it. Once the user is a board writer, he will be able to post threads to the board. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited

Overrides:
grantBoardWriter in class TdBoard
Parameters:
tdUser - a Threaded Discussions user to whom the board moderator role is to be granted
Throws:
TdException - A generic threaded discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.

revokeBoardModerator

public void revokeBoardModerator(TdUser tdUser)
                          throws TdException
Revokes Board Moderator role from the user passed.

Revokes Board Moderator role from the user passed to it. Once the board moderator role is revoked, the user will not be able to post announcements in that board. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited.

Overrides:
revokeBoardModerator in class TdBoard
Parameters:
tdUser - a Threaded Discussions user from whom the Board Moderator role is to be revoked
Throws:
TdException - A generic threaded discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.

revokeBoardReader

public void revokeBoardReader(TdUser tdUser)
                       throws TdException
Revokes Board Reader role from the user passed.

Revokes Board Reader role from the user passed to it. Once the board reader role is revoked, the user will not be able to read the threads in the board. He cannnot access the board at all. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited.

Overrides:
revokeBoardReader in class TdBoard
Parameters:
tdUser - a Threaded Discussions user from whom the board reader role is to be revoked
Throws:
TdException - A generic threaded discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.

revokeBoardWriter

public void revokeBoardWriter(TdUser tdUser)
                       throws TdException
Revokes Board Writer role from the user passed.

Revokes Board Writer role from the user passed to it. Once the Board Writer role is revoked, the user will not be able to post messages to the board. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited.

Overrides:
revokeBoardWriter in class TdBoard
Parameters:
tdUser - a Threaded Discussions user from whom the board writer role is to be revoked
Throws:
TdException - A generic threaded discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.

isPublic

public boolean isPublic()
                 throws TdException
Returns if the board is marked for the public access.

Returns a true boolean status indicating the board is marked for public viewing. An Announcements board is always public so that the announcements are seen by all the members of the discussions community.

Overrides:
isPublic in class TdBoard
Returns:
boolean
Throws:
TdException - A generic threaded discussions exception. This method doesnot throw exception in practice. A throws clause is added to preserve the inheritane syntax.

markPublic

public void markPublic(boolean bPublic)
                throws TdException
Marks the board for public access.

Marks the board for the public usage. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited.

Parameters:
bPublic - boolean variable indicating whether the public usage is to be turned on/off
Throws:
TdException - A generic threaded discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.

lock

public void lock()
          throws TdException
Tries to lock the board so that only moderator and administrator can write to the board.

Applies lock to the board. Only moderator and administrator can post messages to a locked board. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited

Overrides:
lock in class TdBoard
Throws:
TdException - A generic threaded discussions exception encapsulating the error message indicating that the current user is not authorized to lock announcements board.

unlock

public void unlock()
            throws TdException
Unlocks the Board so that the board writers can post messages to the board.

Unlocks the Announcements board. Once a board is unlocked, board writers can also post messages to the board. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited

Overrides:
unlock in class TdBoard
Throws:
TdException - A generic threaded discussions exception encapsulating the error message indicating that the current user is not authorized to unlock announcements board.

isLocked

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

Returns a boolean value indicating if the board is locked/unlocked. Since an announcements board is always marked for the public access, this method always returns false.

Overrides:
isLocked in class TdBoard
Returns:
boolean
Throws:
TdException - A generic threaded discussions exception. This method doesnot throw the exception in practice. A throws clause is added to preserve the inheritance syntax.

delete

public void delete()
            throws TdException
Deletes the board.

This method tries to delete the board. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited.

Overrides:
delete in class TdBoard
Throws:
TdException - A generic threaded discussions exception encapsulating the error message indicating that the current user is not authorized to delete announcements board.
See Also:
oracle.discussions.sdk.TdStore#deleteFacility

updateContainerSettings

public void updateContainerSettings(TdContainerSettings tdCntSettings)
                             throws TdException
Updates the board settings with the settings object passed.

Updates board settings with the new settings from the settings object passed. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited.

Overrides:
updateContainerSettings in class TdContainer
Parameters:
tdCntSettings - Container Settings object with which the board settings are updated
Throws:
TdException - A generic thrreaed discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.

getParentFacility

public TdFacility getParentFacility()
                             throws TdException
Returns the parent container which holds the board.

Returns the parent container which holds the board. In the case of an announcements board, the parent container is null since the board is at root level. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited

Overrides:
getParentFacility in class TdContainer
Returns:
null if not parent is found
Throws:
TdException - A generic threaded discussions exception. The exception is not thrown by this method in practice. A throws clause is added to preserve inheritence syntax.

setDescription

public void setDescription(java.lang.String description)
                    throws TdException,
                           javax.mail.MessagingException
Sets the description for the board.

Sets the description of the board. Description indicates the type of discussions hosted in the board. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited

Parameters:
description - The description which is set to the board
Throws:
TdException - A generic threaded discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.
javax.mail.MessagingException - Oracle Email Specific Exception. This exception is not throws by this method in practice. A throws clause is added to preserve the inheritance syntax.

getDisplayName

public java.lang.String getDisplayName()
Returns board display name.

Returns board display name. Display name can be changed once the board is created.

Overrides:
getDisplayName in class TdContainer
Returns:
String

isFavorite

public boolean isFavorite()
                   throws TdException,
                          javax.mail.MessagingException
Returns if the board is marked as a favorite container.

Returns a boolean status indicating if the board is marked as a favorite board. Since the announcements board is an implicit board, it cannot be marked as a favorite board. Hence the method always returns false.

Specified by:
isFavorite in interface TdFavorite
Overrides:
isFavorite in class TdContainer
Returns:
boolean
Throws:
TdException - A Generic Threaded Discussions exception
javax.mail.MessagingException - Oracle Email specific exception. The method does not throw any exception in practice. throws clause is added to preserve the inheritence syntax.

addToFavorites

public void addToFavorites()
                    throws TdException,
                           javax.mail.MessagingException
Adds the board to the list of favorites.

Adds the specified board to the list of favorites. Since an announcements board is implicit, it cannot be added to the list of favorites. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited

Specified by:
addToFavorites in interface TdFavorite
Overrides:
addToFavorites in class TdContainer
Throws:
TdException - A Generic Threaded Discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.
javax.mail.MessagingException - Oracle Email Specific exception. This is not thrown by this method in practice. throws clause is added to preserve the inheritance syntax.

removeFromFavorites

public void removeFromFavorites()
                         throws TdException,
                                javax.mail.MessagingException
Removes the board from list of favorites.

Removes the specified container from the list of favorites. Since an announcement board is implicit, it can be neither added nor removed from favorites If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited.

Specified by:
removeFromFavorites in interface TdFavorite
Overrides:
removeFromFavorites in class TdContainer
Throws:
TdException - A Generic Threaded Discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.
javax.mail.MessagingException

updateGranteeRoles

public void updateGranteeRoles(java.util.List lstOfRoles)
                        throws TdException
Updates the user roles from the list of roles passed as the argument.

Updates user roles from the list of roles provided. If the Board is AnnouncementsBoard, it throws TdException because announcements board is a special board into which the administrator only can post messages and the board permissions cannot be edited.

Overrides:
updateGranteeRoles in class TdContainer
Parameters:
lstOfRoles - the list of user roles to be applied
Throws:
TdException - A Generic Threaded Discussions exception encapsulating the error message indicating that the current user is not authorized to edit announcements board.

getAnnouncementsBoard

public TdBoard getAnnouncementsBoard()
                              throws TdException
Returns the announcements board.

Returns the announcements board under the current container.

Overrides:
getAnnouncementsBoard in class TdContainer
Returns:
TdBoard
Throws:
TdException - Exception is not thrown by this method in practice. a throws clause is added to preserve the inheritance syntax
See Also:
TdBoard.java

getThread

public TdThread getThread(int iThreadId)
                   throws TdException,
                          javax.mail.MessagingException
Returns a particular thread in the board given its Thread ID.

This method returns a TdThread object from the announcements board given the thread id.

Overrides:
getThread in class TdBoard
Parameters:
iThreadId - Thread id for which the thread object is to be returned
Returns:
TdThread
Throws:
TdException - A Generic Threaded Discussions exception, may be thrown by ThreadCache, while trying to retrieve thread information.
javax.mail.MessagingException - Oracle Email Specific exception, which also may be thrown by ThreadCache, while trying to retrieve thread information
See Also:
ThreadCache.java, TdThreadInfo.java

getThreads

public TdIterator getThreads(int iFetchStart,
                             boolean bSortByCreation,
                             boolean bAscending)
                      throws TdException
Returns a thread iterator comprising of threads in the announcements board.

Takes in the thread start id, the boolean value indicating the sort type and another boolean variable indicating the sort order and returns a TdIterator object containing TdThread objects sorted in the order specified by bSortByCreation bAscending boolean variables.

Overrides:
getThreads in class TdBoard
Parameters:
iFetchStart - variable indicating the starting thread number
bSortByCreation - boolean variable indicating if threads are to be sorted by creation date
bAscending - boolean variable indicating if threads are to be sorted in ascending order
Returns:
TdIterator
Throws:
TdException - A Generic Threaded Discussions exception, may be thrown by
  • BoardCache, when trying to retrieve the threads in the board
  • See Also:
    CacheManager.java, BoardCache.java, TdThreadIterator.java

Copyright © 2005, Oracle. All rights reserved.