Jive API (5.0.0.0) Core Javadocs

com.jivesoftware.community.announcements
Interface Announcement

All Superinterfaces:
com.jivesoftware.community.ContainerAware, com.jivesoftware.community.DatedObject, JiveContentObject, JiveObject, com.jivesoftware.community.objecttype.MentionEnabled, com.jivesoftware.community.objecttype.SubjectAware, UserAuthoredObject

public interface Announcement
extends JiveContentObject, com.jivesoftware.community.objecttype.MentionEnabled

Alerts users to important information. Announcements belong to either communities or the system. Each announcement has an optional start date and end date; outside of those dates, the announcement will not be displayed to end users.

Each announcement can have an arbitrary number of extended properties, which allow extra data about the announcement to be stored.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jivesoftware.community.JiveContentObject
JiveContentObject.Field, JiveContentObject.Status
 
Method Summary
 Date getEndDate()
          Returns the date when the announcement should not longer be visible.
 long getObjectID()
           
 Map<String,String> getProperties()
          Retrieve a map of all the extended properties for the announcement.
 Date getStartDate()
          Returns the date when the announcement should first be visible.
 String getSubject()
          Returns the announcement subject.
 String getUnfilteredSubject()
          Returns the annoucenment subject, bypassing any active filters.
 User getUser()
          Returns the User that is the author of the announcemnt.
 boolean isMinorCreateEdit()
          Returns whether this is a minor create/edit for an announcement.
 void setBody(Document body)
          Sets the body of this announcement.
 void setEndDate(Date endDate)
          Sets the date when the announcement should not longer be visible.
 void setMinorCreateEdit(boolean minorCreateEdit)
          Sets whether this is a minor create/edit for an announcement.
 void setProperties(Map<String,String> properties)
          Set the properties for the announcement.
 void setStartDate(Date startDate)
          Sets the start date for when the announcement should first be visible.
 void setStatus(JiveContentObject.Status status)
          Returns the visibility state of the object.
 void setSubject(String subject)
          Sets the announcement subject.
 
Methods inherited from interface com.jivesoftware.community.JiveContentObject
getBody, getContainerID, getContainerType, getCreationDate, getJiveObjectType, getModificationDate, getPlainBody, getStatus
 
Methods inherited from interface com.jivesoftware.community.UserAuthoredObject
getAuthorIDs, getAuthors, getUserID
 
Methods inherited from interface com.jivesoftware.community.objecttype.SubjectAware
getPlainSubject
 
Methods inherited from interface com.jivesoftware.community.JiveObject
getID, getObjectType
 

Method Detail

getUser

User getUser()
Returns the User that is the author of the announcemnt.

Specified by:
getUser in interface UserAuthoredObject
Returns:
the author of the announement.

getStartDate

Date getStartDate()
Returns the date when the announcement should first be visible.

Returns:
the date when the announcement is first visible.

setStartDate

void setStartDate(Date startDate)
                  throws UnauthorizedException
Sets the start date for when the announcement should first be visible.

Parameters:
startDate - the date the announcement should first be visible.
Throws:
UnauthorizedException - if not allowed to set the start date.

getEndDate

Date getEndDate()
Returns the date when the announcement should not longer be visible. If the end date is null, the announcement will never end.

Returns:
the date when the announcement is no longer visible.

setEndDate

void setEndDate(Date endDate)
                throws UnauthorizedException
Sets the date when the announcement should not longer be visible. If the end date is null, the announcement will never end.

Parameters:
endDate - the date when the announcement is no longer visible.
Throws:
UnauthorizedException - if not allowed to set the end date.

getSubject

String getSubject()
Returns the announcement subject. If filters are active, the subject returned will be a filtered one. Because filters often provide security functionality, this method is the preferred way to get the subject of an announcement.

Specified by:
getSubject in interface com.jivesoftware.community.objecttype.SubjectAware
Returns:
the subject of this message.

setSubject

void setSubject(String subject)
                throws UnauthorizedException
Sets the announcement subject.

Parameters:
subject - the subject.
Throws:
UnauthorizedException - if not allowed to set the subject.

getUnfilteredSubject

String getUnfilteredSubject()
Returns the annoucenment subject, bypassing any active filters. Because filters often provide security, this method should be used with caution. In particular, you should avoid showing unfiltered data in an environment where embedded HTML might be interpreted.

Unfiltered content is necessary for a few reasons. One is when saving content to another persistence mechanism such as an XML format.

Specified by:
getUnfilteredSubject in interface JiveContentObject
Returns:
the subject of this message.

setBody

void setBody(Document body)
             throws UnauthorizedException
Sets the body of this announcement.

Parameters:
body - the body.
Throws:
UnauthorizedException - if not allowed to set the body.

getProperties

Map<String,String> getProperties()
Retrieve a map of all the extended properties for the announcement. Each announcement can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface. The map is alterable if the user is authorized to modify the announcement. Null keys and values are not allowed.

If the user is not authorized to modify the announcement any method which modifies the map will fail with a UnsupportedOperationException;

Returns:
a map of announcement extended properties.

setProperties

void setProperties(Map<String,String> properties)
Set the properties for the announcement. Each announcement can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface.

Parameters:
properties - the properties to set

getObjectID

long getObjectID()

setStatus

void setStatus(JiveContentObject.Status status)
               throws UnauthorizedException
Returns the visibility state of the object.

Parameters:
status - thie visibility state of the object
Throws:
UnauthorizedException - if not allowed to edit the announcement.

isMinorCreateEdit

boolean isMinorCreateEdit()
Returns whether this is a minor create/edit for an announcement. If it is a minor create/edit, notification emails are not sent out

Returns:
true or false whether this is a minor create/edit for an announcement

setMinorCreateEdit

void setMinorCreateEdit(boolean minorCreateEdit)
Sets whether this is a minor create/edit for an announcement. If it is a minor create/edit, notification emails are not sent out

Parameters:
minorCreateEdit - true or false whether this is a minor create/edit for an announcement

Jive Product Page

Copyright © 1999-2007 Jive Software.