Clearspace API (2.5.18) Core Javadocs

com.jivesoftware.community
Interface AnnouncementManager

All Superinterfaces:
JiveManager

public interface AnnouncementManager
extends JiveManager

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

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, JiveContainer jiveContainer)
          Creates a new community announcement.
 void deleteAnnouncement(Announcement announcement)
          Deletes an announcement.
 void deleteUserAnnouncements(User user)
          Deletes all of a user's announcements.
 Announcement getAnnouncement(long announcementID)
          Returns an announcement by announcement ID.
 int getAnnouncementCount(JiveContainer jiveContainer)
          Returns the count of all currently viewable announcements in a container.
 int getAnnouncementCount(JiveContainer jiveContainer, boolean recursive)
          Returns the count of all currently viewable announcements in a container.
 int getAnnouncementCount(JiveContainer jiveContainer, Date startDate, Date endDate)
          Returns the count of all announcements in a container that are viewable within the specified date range.
 JiveIterator<Announcement> getAnnouncements(JiveContainer jiveContainer)
          Returns all currently viewable announcements in a container.
 JiveIterator<Announcement> getAnnouncements(JiveContainer jiveContainer, Date startDate, Date endDate)
          Returns the announcements in a container that are viewable within a specified date range.
 void updateAnnouncement(Announcement announcement)
          Updates an announcement to the database.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

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,
                                JiveContainer jiveContainer)
                                throws UnauthorizedException
Creates a new community 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.
jiveContainer - the jiveContainer 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 RejectedException,
                            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:
RejectedException - if one of the installed interceptors prevents the announcement from being posted.
UnauthorizedException - if not allowed to create a system annoucement.
IllegalStateException - if the announcement has already been added.

updateAnnouncement

void updateAnnouncement(Announcement announcement)
                        throws UnauthorizedException
Updates an announcement to the database.

Parameters:
announcement - the announcement to updated in the database.
Throws:
UnauthorizedException - if not allowed to create a system annoucement.
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(JiveContainer jiveContainer)
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 Community object.

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

getAnnouncementCount

int getAnnouncementCount(JiveContainer jiveContainer,
                         boolean recursive)
Returns the count of all currently viewable announcements in a container. If container is null then the count of system announcements will be returned. Otherwise, the container should be a Community object. If recursive is false then sub community announcement counts are excluded from the returned value.

Parameters:
jiveContainer - a jiveContainer, or null for system announcements.
recursive - a flag to determine if sub communities are included in the calculation. included.
Returns:
the count of all currently viewable announcements in the container.

getAnnouncementCount

int getAnnouncementCount(JiveContainer jiveContainer,
                         Date startDate,
                         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 Community 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:
jiveContainer - a jiveContainer, 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

JiveIterator<Announcement> getAnnouncements(JiveContainer jiveContainer)
Returns all currently viewable announcements in a container. If container is null than system announcements will be returned. Otherwise, the container should be a Community object.

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

getAnnouncements

JiveIterator<Announcement> getAnnouncements(JiveContainer jiveContainer,
                                            Date startDate,
                                            Date endDate)
Returns the announcements in a container that are viewable within a specified date range. If container is null than system announcements will be returned. Otherwise, the container should be a Community 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:
jiveContainer - a jiveContainer, 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.

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.

deleteUserAnnouncements

void deleteUserAnnouncements(User user)
                             throws UnauthorizedException
Deletes all of a user's announcements.

Parameters:
user - the author of the announcements being deleted.
Throws:
UnauthorizedException - if not allowed to delete the announcements.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.