org.sakaiproject.tool.announcement
Class AnnouncementAction.AnnouncementWrapper

java.lang.Object
  extended byorg.sakaiproject.tool.announcement.AnnouncementAction.AnnouncementWrapper
All Implemented Interfaces:
AnnouncementMessage, Comparable, Entity, Message
Enclosing class:
AnnouncementAction

public static class AnnouncementAction.AnnouncementWrapper
extends Object
implements AnnouncementMessage

Decorator for the "Message" class. It adds various properties to the decorated real Announcement message.


Field Summary
 
Fields inherited from interface org.sakaiproject.service.legacy.entity.Entity
SEPARATOR
 
Constructor Summary
AnnouncementAction.AnnouncementWrapper(AnnouncementAction.AnnouncementWrapper mWrapper)
          Constructor
AnnouncementAction.AnnouncementWrapper(AnnouncementMessage message, AnnouncementChannel currentChannel, AnnouncementChannel hostingChannel, AnnouncementActionState.DisplayOptions options, String range)
          Constructor
 
Method Summary
 int compareTo(Object arg0)
           
 AnnouncementMessageHeader getAnnouncementHeader()
          A (AnnouncementMessageHeader) cover for getHeader to access the announcement message header.
 String getBody()
          Access the body, as a string.
 String getChannelDisplayName()
          Returns the string that is used to show the channel to the user.
 MessageHeader getHeader()
          Access the message header.
 String getId()
          Access the id of the entity.
 AnnouncementMessage getMessage()
           
 ResourceProperties getProperties()
          Access the entity's properties.
 String getRange()
          returns the range string
 String getReference()
          Access the internal reference which can be used to access the entity from within the system.
 String getReference(String rootProperty)
          Access the alternate internal reference which can be used to access the entity from within the system.
 String getTrimmedBody()
           
 String getUrl()
          Access the URL which can be used to access the entity.
 String getUrl(String rootProperty)
          Access the alternate URL which can be used to access the entity.
 boolean isEditable()
          Returns true if the message is editable.
 void setRange(String range)
          Set the range string
 Element toXml(Document doc, Stack stack)
          Serialize the entity into XML, adding an element to the doc under the top of the stack element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnouncementAction.AnnouncementWrapper

public AnnouncementAction.AnnouncementWrapper(AnnouncementMessage message,
                                              AnnouncementChannel currentChannel,
                                              AnnouncementChannel hostingChannel,
                                              AnnouncementActionState.DisplayOptions options,
                                              String range)
Constructor

Parameters:
message - The message to be wrapped.
currentChannel - The channel in which the message is contained.
hostingChannel - The channel into which the message is being merged.

AnnouncementAction.AnnouncementWrapper

public AnnouncementAction.AnnouncementWrapper(AnnouncementAction.AnnouncementWrapper mWrapper)
Constructor

Method Detail

getMessage

public AnnouncementMessage getMessage()

getHeader

public MessageHeader getHeader()
Description copied from interface: Message
Access the message header.

Specified by:
getHeader in interface Message
Returns:
The message header.

getBody

public String getBody()
Description copied from interface: Message
Access the body, as a string.

Specified by:
getBody in interface Message
Returns:
The body, as a string.

getTrimmedBody

public String getTrimmedBody()

getUrl

public String getUrl()
Description copied from interface: Entity
Access the URL which can be used to access the entity.

Specified by:
getUrl in interface Entity
Returns:
The URL which can be used to access the entity.

getReference

public String getReference()
Description copied from interface: Entity
Access the internal reference which can be used to access the entity from within the system.

Specified by:
getReference in interface Entity
Returns:
The the internal reference which can be used to access the entity from within the system.

getReference

public String getReference(String rootProperty)
Description copied from interface: Entity
Access the alternate internal reference which can be used to access the entity from within the system.

Specified by:
getReference in interface Entity
Parameters:
rootProperty - The name of the entity property whose value controls which alternate reference is requested. If null, the native 'raw' reference is requested.
Returns:
The the alternate internal reference which can be used to access the entity from within the system.

getUrl

public String getUrl(String rootProperty)
Description copied from interface: Entity
Access the alternate URL which can be used to access the entity.

Specified by:
getUrl in interface Entity
Parameters:
rootProperty - The name of the entity property whose value controls which alternate reference URL is requested. If null, the native 'raw' URL is requested.
Returns:
The alternate URL which can be used to access the entity.

getId

public String getId()
Description copied from interface: Entity
Access the id of the entity.

Specified by:
getId in interface Entity
Returns:
The id.

getProperties

public ResourceProperties getProperties()
Description copied from interface: Entity
Access the entity's properties.

Specified by:
getProperties in interface Entity
Returns:
The entity's properties.

getRange

public String getRange()
returns the range string

Returns:

setRange

public void setRange(String range)
Set the range string

Returns:

toXml

public Element toXml(Document doc,
                     Stack stack)
Description copied from interface: Entity
Serialize the entity into XML, adding an element to the doc under the top of the stack element.

Specified by:
toXml in interface Entity
Parameters:
doc - The DOM doc to contain the XML (or null for a string return).
stack - The DOM elements, the top of which is the containing element of the new "entity" element.
Returns:
The newly added element.

compareTo

public int compareTo(Object arg0)
Specified by:
compareTo in interface Comparable

isEditable

public boolean isEditable()
Returns true if the message is editable.


getChannelDisplayName

public String getChannelDisplayName()
Returns the string that is used to show the channel to the user.


getAnnouncementHeader

public AnnouncementMessageHeader getAnnouncementHeader()
Description copied from interface: AnnouncementMessage
A (AnnouncementMessageHeader) cover for getHeader to access the announcement message header.

Specified by:
getAnnouncementHeader in interface AnnouncementMessage
Returns:
The announcement message header.