org.sakaiproject.announcement.tool
Class AnnouncementActionState

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

public class AnnouncementActionState
extends org.sakaiproject.cheftool.ControllerState
implements org.sakaiproject.tool.api.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.


Nested Class Summary
static class AnnouncementActionState.DisplayOptions
          Holds the display options for the Announcements tool
 
Field Summary
static int DEFAULT_DAYS_IN_PAST_OPTION
           
static int DEFAULT_DISPLAY_NUMBER_OPTION
           
 
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
 org.sakaiproject.site.api.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
 Boolean getTempHidden()
           
 Vector getTempMoreAttachments()
          Get
 org.sakaiproject.time.api.Time getTempReleaseDate()
           
 org.sakaiproject.time.api.Time getTempRetractDate()
           
 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(org.sakaiproject.site.api.Site site)
           
 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 setTempHidden(Boolean hidden)
           
 void setTempMoreAttachments(Vector tempMoreAttachments)
          Set
 void setTempReleaseDate(org.sakaiproject.time.api.Time tempDate)
           
 void setTempRetractDate(org.sakaiproject.time.api.Time tempDate)
           
 void setTempSubject(String tempSubject)
          Get
 void update(Observable o, Object arg)
          This method is called whenever the observed object is changed.
 void valueBound(org.sakaiproject.tool.api.SessionBindingEvent event)
          SessionBindingListener implementation
 void valueUnbound(org.sakaiproject.tool.api.SessionBindingEvent event)
           
 
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
 

Field Detail

DEFAULT_DISPLAY_NUMBER_OPTION

public static int DEFAULT_DISPLAY_NUMBER_OPTION

DEFAULT_DAYS_IN_PAST_OPTION

public static int DEFAULT_DAYS_IN_PAST_OPTION
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 org.sakaiproject.cheftool.ControllerState

init

protected void init()
Init to startup values

Overrides:
init in class org.sakaiproject.cheftool.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


setTempReleaseDate

public void setTempReleaseDate(org.sakaiproject.time.api.Time tempDate)

getTempReleaseDate

public org.sakaiproject.time.api.Time getTempReleaseDate()

setTempRetractDate

public void setTempRetractDate(org.sakaiproject.time.api.Time tempDate)

getTempRetractDate

public org.sakaiproject.time.api.Time getTempRetractDate()

getTempHidden

public Boolean getTempHidden()

setTempHidden

public void setTempHidden(Boolean hidden)

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.

Parameters:
channel - 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

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

Parameters:
preview_status - 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

Parameters:
m_isListVM: - 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 org.sakaiproject.cheftool.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 org.sakaiproject.site.api.Site getEditSite()

setEditSite

public void setEditSite(org.sakaiproject.site.api.Site site)

getDisplayOptions

public AnnouncementActionState.DisplayOptions getDisplayOptions()

setDisplayOptions

public void setDisplayOptions(AnnouncementActionState.DisplayOptions options)

valueBound

public void valueBound(org.sakaiproject.tool.api.SessionBindingEvent event)
SessionBindingListener implementation

Specified by:
valueBound in interface org.sakaiproject.tool.api.SessionBindingListener

valueUnbound

public void valueUnbound(org.sakaiproject.tool.api.SessionBindingEvent event)
Specified by:
valueUnbound in interface org.sakaiproject.tool.api.SessionBindingListener


Copyright © 2003-2012 The Sakai Foundation. All Rights Reserved.