Jive Forums API (5.5.20.2-oracle) Core Javadocs

com.jivesoftware.forum
Interface AnnouncementManager


public interface AnnouncementManager

Manages announcements, including viewing, creating, and deleting them.

Since:
4.0
See Also:
Announcement

Method Summary
 void addAnnouncement(Announcement announcement)
          Adds an an announcement to the database.
 Announcement createAnnouncement(User user)
          Creates a new system announcement.
 Announcement createAnnouncement(User user, Forum forum)
          Creates a new forum announcement.
 Announcement createAnnouncement(User user, ForumCategory category)
          Creates a new category announcement.
 void deleteAnnouncement(Announcement announcement)
          Deletes an announcement.
 Announcement getAnnouncement(long announcementID)
          Returns an announcement by announcement ID.
 int getAnnouncementCount(java.lang.Object container)
          Returns the count of all currently viewable announcements in a container.
 int getAnnouncementCount(java.lang.Object container, java.util.Date startDate, java.util.Date endDate)
          Returns the count of all announcements in a container that are viewable within the specified date range.
 java.util.Iterator getAnnouncements(java.lang.Object container)
          Returns all currently viewable announcements in a container.
 java.util.Iterator getAnnouncements(java.lang.Object container, java.util.Date startDate, java.util.Date endDate)
          Returns the announcements in a container that are viewable within a specified date range.If container is null then system announcements will be returned.
 int getRecursiveAnnouncementCount(ForumCategory category)
          Returns the count of all currently viewable announcements in a ForumCategory and its child Forums and SubCategories.
 java.util.Iterator getRecursiveAnnouncements(ForumCategory category, int startIndex, int numResults)
          Returns all currently viewable announcements in a ForumCategory and its child Forums and SubCategories.
 

Method Detail

createAnnouncement

Announcement createAnnouncement(User user)
                                throws UnauthorizedException
Creates a new system announcement. After an announcement is created and the appropriate values are set, it must be added to the database by calling the addAnnouncement(Announcement) method.

Parameters:
user - the user creating the announcement.
Returns:
a new Announcement.
Throws:
UnauthorizedException - if not allowed to create a system annoucement.

createAnnouncement

Announcement createAnnouncement(User user,
                                ForumCategory category)
                                throws UnauthorizedException
Creates a new category announcement. After an announcement is created and the appropriate values are set, it must be added to the database by calling the addAnnouncement(Announcement) method.

Parameters:
user - the user creating the announcement.
category - the category to add the announcement to.
Returns:
a new Announcement.
Throws:
UnauthorizedException - if not allowed to create a system annoucement.

createAnnouncement

Announcement createAnnouncement(User user,
                                Forum forum)
                                throws UnauthorizedException
Creates a new forum announcement. After an announcement is created and the appropriate values are set, it must be added to the database by calling the addAnnouncement(Announcement) method.

Parameters:
user - the user creating the announcement.
forum - the forum to add the announcement to.
Returns:
a new Announcement.
Throws:
UnauthorizedException - if not allowed to create a system annoucement.

addAnnouncement

void addAnnouncement(Announcement announcement)
                     throws UnauthorizedException
Adds an an announcement to the database. This method must be called after the announcement is created and all appropriate values on it have been set. After this method is called, the announcement will be immediately viewable to others (assuming the start date permits this).

Parameters:
announcement - the announcement to add to the database.
Throws:
UnauthorizedException - if not allowed to create a system annoucement.
java.lang.IllegalStateException - if the announcement has already been added.

getAnnouncement

Announcement getAnnouncement(long announcementID)
                             throws AnnouncementNotFoundException,
                                    UnauthorizedException
Returns an announcement by announcement ID.

Parameters:
announcementID - the ID of the announcement to return.
Returns:
the announcement.
Throws:
AnnouncementNotFoundException - if the announcement could not be loaded or does not exist.
UnauthorizedException - if not allowed to get the announcement.

getAnnouncementCount

int getAnnouncementCount(java.lang.Object container)
Returns the count of all currently viewable announcements in a container. If container is null than the count of system announcements will be returned. Otherwise, the container should be a ForumCategory or Forum object.

Parameters:
container - a forum, category, or null for system announcements.
Returns:
the count of all currently viewable announcements in the container.

getRecursiveAnnouncementCount

int getRecursiveAnnouncementCount(ForumCategory category)
Returns the count of all currently viewable announcements in a ForumCategory and its child Forums and SubCategories. If the category is null then the count of all announcements in the system will be returned, including System Announcements.

Parameters:
category - a category, or null for system announcements.
Returns:
the recursive count of all currently viewable announcements in the category and its children.

getAnnouncementCount

int getAnnouncementCount(java.lang.Object container,
                         java.util.Date startDate,
                         java.util.Date endDate)
Returns the count of all announcements in a container that are viewable within the specified date range. If container is null than the count of system announcements will be returned. Otherwise, the container should be a ForumCategory or Forum object. If startDate or endDate are null than the date range will be unbounded in that direction. For example, to get a count of all announcements regardless of starting and ending dates, pass in null as the value for both parameters.

Parameters:
container - a forum, category, or null for system announcements.
startDate - the start date of announcements, or null to leave this value unbounded.
endDate - the end date of announcements, or null to leave this value unbounded.
Returns:
the count of all announcements in the container that are viewable within the specified date range.

getAnnouncements

java.util.Iterator getAnnouncements(java.lang.Object container)
Returns all currently viewable announcements in a container. If container is null than system announcements will be returned. Otherwise, the container should be a ForumCategory or Forum object.

Parameters:
container - a forum, category, or null for system announcements.
Returns:
the count of all currently viewable announcements in the container.

getAnnouncements

java.util.Iterator getAnnouncements(java.lang.Object container,
                                    java.util.Date startDate,
                                    java.util.Date endDate)
Returns the announcements in a container that are viewable within a specified date range.If container is null then system announcements will be returned. Otherwise, the container should be a ForumCategory or Forum object. If startDate or endDate are null than the date range will be unbounded in that direction. For example, to get all announcements regardless of starting and ending dates, pass in null as the value for both parameters.

Parameters:
container - a forum, category, or null for system announcements.
startDate - the start date of announcements, or null to leave this value unbounded.
endDate - the end date of announcements, or null to leave this value unbounded.
Returns:
all announcements in the container that are viewable within the the specified date range.

getRecursiveAnnouncements

java.util.Iterator getRecursiveAnnouncements(ForumCategory category,
                                             int startIndex,
                                             int numResults)
Returns all currently viewable announcements in a ForumCategory and its child Forums and SubCategories. If the category is null then the all viewable announcements in the system will be returned, including the System Announcements.

Parameters:
category - a category, or null for system announcements.
Returns:
the recursive count of all currently viewable announcements in the category and its children.

deleteAnnouncement

void deleteAnnouncement(Announcement announcement)
                        throws UnauthorizedException
Deletes an announcement.

Parameters:
announcement - the announcement to delete.
Throws:
UnauthorizedException - if not allowed to delete the announcement.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.