org.sakaiproject.tool.announcement
Class AnnouncementActionState

java.lang.Object
  extended byorg.sakaiproject.cheftool.ControllerState
      extended byorg.sakaiproject.tool.announcement.AnnouncementActionState
All Implemented Interfaces:
EventListener, Observer, SessionBindingListener

public class AnnouncementActionState
extends ControllerState
implements SessionBindingListener

AnnouncementActionState is the state object for the AnnouncementAction tool. This object listens for changes on the announcement, and requests a UI delivery when changes occur.

Version:
$Revision: 4742 $
Author:
University of Michigan, CHEF Software Development Team

Nested Class Summary
static class AnnouncementActionState.DisplayOptions
          Holds the display options for the Announcements tool
 
Constructor Summary
AnnouncementActionState()
          Creates new AnnouncementActionState
 
Method Summary
 List getAttachments()
          Get
 Vector getAttachProperties(String key)
          Get the attachment properties
 String getChannelId()
          Get the channel id of current state
protected  boolean getCurrentSortAsc()
          get the current sort property
protected  String getCurrentSortedBy()
          get the current sorted by property name
 Vector getDelete_messages()
          Get
 AnnouncementActionState.DisplayOptions getDisplayOptions()
           
 AnnouncementMessageEdit getEdit()
          Get edit object
 Site getEditSite()
           
 Vector getFileProperties(String key)
          Get the the file properties for uploading
 boolean getIsListVM()
          Get the current vm: true - in main list view; false - in other view
 boolean getIsNewAnnouncement()
          Get the status of preview: true - view new created; false - view revised existed
 String getMessageReference()
          Returns the currently selected message reference.
 Vector getMoreAttachments()
          Get
 Vector getSelectedAttachments()
          Get
 String getStatus()
          Get the status to be
 String getTempAnnounceTo()
          Get
 Collection getTempAnnounceToGroups()
          Get
 Vector getTempAttachments()
          Get
 String getTempBody()
          Get
 Vector getTempMoreAttachments()
          Get
 String getTempSubject()
          Get
protected  void init()
          Init to startup values
 void recycle()
          Release any resources and restore the object to initial conditions to be reused.
 void setAttachments(List attachments)
          Set
 void setAttachProperties(String key, Vector properties)
          Set the attachProperties
 void setChannelId(String channelId)
          Set the chat channel id to listen to.
protected  void setCurrentSortAsc(boolean asc)
          set the current sort property
protected  void setCurrentSortedBy(String name)
          set the current sorted by property name
 void setDeleteMessages(Vector delete_messages)
          Set
 void setDisplayOptions(AnnouncementActionState.DisplayOptions options)
           
 void setEdit(AnnouncementMessageEdit edit)
          Get edit The edit object
 void setEditSite(Site site)
           
 void setFF(String key)
           
 void setFileProperties(String key, Vector properties)
          Set the fileProperties
 void setIsListVM(boolean isListVM)
          Set the current vm: true - in main list view; false - in other view
 void setIsNewAnnouncement(boolean isNewAnn)
          Set the status of preview: true - view new created; false - view revised existed
 void setMessageReference(String string)
          Sets the currently selected message reference.
 void setMoreAttachments(Vector moreAttachments)
          Set
 void setSelectedAttachments(Vector selectedAttachments)
          Set
 void setStatus(String status)
          Set the status to be
 void setTempAnnounceTo(String tempAnnounceTo)
          set
 void setTempAnnounceToGroups(Collection tempAnnounceToGroups)
          set
 void setTempAttachments(Vector tempAttachments)
          Set
 void setTempBody(String tempBody)
          Get
 void setTempMoreAttachments(Vector tempMoreAttachments)
          Set
 void setTempSubject(String tempSubject)
          Get
 void update(Observable o, Object arg)
          This method is called whenever the observed object is changed.
 void valueBound(SessionBindingEvent event)
          SessionBindingListener implementation
 void valueUnbound(SessionBindingEvent event)
          Notifies the object that it is being unbound from a session.
 
Methods inherited from class org.sakaiproject.cheftool.ControllerState
getId, getKey, getSetId, setId, setSetId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnouncementActionState

public AnnouncementActionState()
Creates new AnnouncementActionState

Method Detail

recycle

public void recycle()
Release any resources and restore the object to initial conditions to be reused.

Overrides:
recycle in class ControllerState

init

protected void init()
Init to startup values

Overrides:
init in class ControllerState

getTempSubject

public String getTempSubject()
Get


getTempBody

public String getTempBody()
Get


getTempAnnounceTo

public String getTempAnnounceTo()
Get


setTempAnnounceTo

public void setTempAnnounceTo(String tempAnnounceTo)
set


getTempAnnounceToGroups

public Collection getTempAnnounceToGroups()
Get


setTempAnnounceToGroups

public void setTempAnnounceToGroups(Collection tempAnnounceToGroups)
set


setTempSubject

public void setTempSubject(String tempSubject)
Get


setTempBody

public void setTempBody(String tempBody)
Get


getChannelId

public String getChannelId()
Get the channel id of current state

Returns:
The current channel id

setChannelId

public void setChannelId(String channelId)
Set the chat channel id to listen to.


getFileProperties

public Vector getFileProperties(String key)
Get the the file properties for uploading

Returns:
The current collectionId

setFileProperties

public void setFileProperties(String key,
                              Vector properties)
Set the fileProperties

Parameters:
key - The key for map class, which is the absolute local path of file
properties - The Vector which stores the inputStream, contentType, fileName of the file in order

getAttachProperties

public Vector getAttachProperties(String key)
Get the attachment properties

Returns:
The property based on the given key

setAttachProperties

public void setAttachProperties(String key,
                                Vector properties)
Set the attachProperties

Parameters:
key - The key for map class, which is the absolute local path of file
properties - The Vector which stores the attachment properties: title, description, and copyright in order

setFF

public void setFF(String key)

getIsNewAnnouncement

public boolean getIsNewAnnouncement()
Get the status of preview: true - view new created; false - view revised existed

Returns:
The current status

setIsNewAnnouncement

public void setIsNewAnnouncement(boolean isNewAnn)
Set the status of preview: true - view new created; false - view revised existed


getIsListVM

public boolean getIsListVM()
Get the current vm: true - in main list view; false - in other view

Returns:
The boolean to show whether in main list view

setIsListVM

public void setIsListVM(boolean isListVM)
Set the current vm: true - in main list view; false - in other view


getDelete_messages

public Vector getDelete_messages()
Get


setDeleteMessages

public void setDeleteMessages(Vector delete_messages)
Set


setEdit

public void setEdit(AnnouncementMessageEdit edit)
Get edit The edit object


getEdit

public AnnouncementMessageEdit getEdit()
Get edit object

Returns:
m_edit The edit object

getAttachments

public List getAttachments()
Get


setAttachments

public void setAttachments(List attachments)
Set


getSelectedAttachments

public Vector getSelectedAttachments()
Get


setSelectedAttachments

public void setSelectedAttachments(Vector selectedAttachments)
Set


getMoreAttachments

public Vector getMoreAttachments()
Get


setMoreAttachments

public void setMoreAttachments(Vector moreAttachments)
Set


getTempAttachments

public Vector getTempAttachments()
Get


setTempAttachments

public void setTempAttachments(Vector tempAttachments)
Set


getTempMoreAttachments

public Vector getTempMoreAttachments()
Get


setTempMoreAttachments

public void setTempMoreAttachments(Vector tempMoreAttachments)
Set


update

public void update(Observable o,
                   Object arg)
This method is called whenever the observed object is changed. An application calls an Observable object's notifyObservers method to have all the object's observers notified of the change. default implementation is to cause the courier service to deliver to the interface controlled by my controller. Extensions can override.

Specified by:
update in interface Observer
Overrides:
update in class ControllerState
Parameters:
o - the observable object.
arg - an argument passed to the notifyObservers method.

getStatus

public String getStatus()
Get the status to be

Returns:
The status to be

setStatus

public void setStatus(String status)
Set the status to be

Parameters:
status - The status to be

setCurrentSortedBy

protected void setCurrentSortedBy(String name)
set the current sorted by property name

Parameters:
name - The sorted by property name

getCurrentSortedBy

protected String getCurrentSortedBy()
get the current sorted by property name

Returns:
"true" if the property is sorted ascendingly; "false" if the property is sorted descendingly

setCurrentSortAsc

protected void setCurrentSortAsc(boolean asc)
set the current sort property

Parameters:
asc - "true" if the property is sorted ascendingly; "false" if the property is sorted descendingly

getCurrentSortAsc

protected boolean getCurrentSortAsc()
get the current sort property

Returns:
"true" if the property is sorted ascendingly; "false" if the property is sorted descendingly

getMessageReference

public String getMessageReference()
Returns the currently selected message reference.


setMessageReference

public void setMessageReference(String string)
Sets the currently selected message reference.


getEditSite

public Site getEditSite()

setEditSite

public void setEditSite(Site site)

getDisplayOptions

public AnnouncementActionState.DisplayOptions getDisplayOptions()

setDisplayOptions

public void setDisplayOptions(AnnouncementActionState.DisplayOptions options)

valueBound

public void valueBound(SessionBindingEvent event)
SessionBindingListener implementation

Specified by:
valueBound in interface SessionBindingListener
Parameters:
event - the event that identifies the session

valueUnbound

public void valueUnbound(SessionBindingEvent event)
Description copied from interface: SessionBindingListener
Notifies the object that it is being unbound from a session.

Specified by:
valueUnbound in interface SessionBindingListener
Parameters:
event - the event that identifies the session