atg.portal.alert
Class GearMessage

java.lang.Object
  extended by atg.portal.alert.PortalMessage
      extended by atg.portal.alert.GearMessage
All Implemented Interfaces:
atg.portal.alert.AlertConstants, java.io.Serializable

public class GearMessage
extends PortalMessage
implements atg.portal.alert.AlertConstants, java.io.Serializable

This message bean extends the PortalMessage class for the purposes of adding properties common to all Gear alerts messages.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from interface atg.portal.alert.AlertConstants
ALERT_ADMIN_ID, ALERT_CHANNEL_COMPONENT_NAME, ALERT_CHANNEL_DISPLAY_NAME, ALERT_CHANNEL_VIEW, ALERT_CHANNELS, ALERT_COMMUNITY_LEADER_TARGET, ALERT_COMMUNITY_TARGET, ALERT_CONTENT_URL, ALERT_CREATION_DATE, ALERT_DELETE_FLAG, ALERT_DISPLAY_STRING, ALERT_EMAIL_TEMPLATE, ALERT_END_DATE, ALERT_EVENT_TYPE, ALERT_FRAMEWORK_ID, ALERT_GEAR_ALERT_ITEM_DESCRIPTOR, ALERT_GEAR_COMMUNITIES_TARGET, ALERT_GEAR_DEF_VIEW, ALERT_GEAR_ID, ALERT_GROUP_VIEW, ALERT_ITEM_DESCRIPTOR, ALERT_LOGIN, ALERT_MESSAGE_BEAN, ALERT_MESSAGE_TYPE, ALERT_NAME, ALERT_NO, ALERT_NOTIFICATION_PREFERENCE, ALERT_NOTIFY_PREFERENCES, ALERT_OPT_IN_OUT, ALERT_ORGANIZATION_TARGET, ALERT_ORIGINATES, ALERT_PROFILE_VIEW, ALERT_PROPERTY_NAMES, ALERT_RESOURCE_BUNDLE, ALERT_ROLE_TARGET, ALERT_SOURCE_ID, ALERT_SOURCE_TYPE, ALERT_START_DATE, ALERT_TARGET_ID, ALERT_TARGET_TYPE, ALERT_USER_TARGET, ALERT_USER_VIEW, ALERT_VALUE, ALERT_YES, ALERT_YES_LOCKED, ALERT_YES_OPENED, COMMUNITY_ID, COMMUNITY_TYPE, COMMUNITY_VIEW, EMAIL_CHANNEL, EVENT_TYPE, GEAR_ID, GEAR_VIEW, ORG_TYPE, ROLE_TYPE, USER_TYPE, WEB_CHANNEL, WIRELESS_CHANNEL
 
Constructor Summary
GearMessage()
           
GearMessage(Environment pEnv, java.lang.String pMessageType)
           
GearMessage(GearEnvironment pGearEnv, java.lang.String pMessageType)
           
GearMessage(java.lang.String pGearId, java.lang.String pCommunityId, java.lang.String pProfileId, java.lang.String pMessageType)
           
GearMessage(java.lang.String pSourceId, java.lang.String pCommunityId, java.lang.String pProfileId, java.lang.String pMessageType, java.util.Date pStartDate, java.util.Date pEndDate, java.util.Date pExpirationDate)
           
 
Method Summary
 java.lang.String getCommunityId()
          Get the community item id
 java.lang.String getCommunityName()
          Get the transient community name property.
 java.lang.String getCommunityName(java.util.Locale pLocale)
          Get the transient community name property based on a locale.
 java.lang.String getGearId()
          Get the gear item id
 java.lang.String getGearName()
          Get the transient gear name property for the default locale.
 java.lang.String getGearName(java.util.Locale pLocale)
          Get the transient gear name property based on a locale.
 java.lang.String getProfileDisplayName()
          Get the profile display name
 java.lang.String getProfileId()
          Get the profile item id
 void postFormatMessage(java.util.Locale pLocale)
          This method should be called by any AlertHandler implementation after formatting and delivery of the alert message.
 void preFormatMessage(java.util.Locale pLocale)
          Dynamically retrieve the CommunityName and GearName in a locale sensitive manner prior to the format and delivery of the alert message.
 void setCommunityId(java.lang.String pCommunityId)
          Set the community item id
 void setCommunityName(java.lang.String pCommunityName)
          Sets the transient community name property.
 void setGearId(java.lang.String pGearId)
          Sets the gear item id
 void setGearName(java.lang.String pGearName)
          Sets the transient gear name property.
 void setProfileDisplayName(java.lang.String pProfileDisplayName)
          Sets the profile display name
 void setProfileId(java.lang.String pProfileId)
          Sets the profile item id
 
Methods inherited from class atg.portal.alert.PortalMessage
getCreationDate, getEndDate, getExpirationDate, getMessageType, getSourceId, getSourceType, getStartDate, setCreationDate, setEndDate, setExpirationDate, setMessageType, setSourceId, setSourceType, setStartDate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

GearMessage

public GearMessage()

GearMessage

public GearMessage(java.lang.String pGearId,
                   java.lang.String pCommunityId,
                   java.lang.String pProfileId,
                   java.lang.String pMessageType)

GearMessage

public GearMessage(java.lang.String pSourceId,
                   java.lang.String pCommunityId,
                   java.lang.String pProfileId,
                   java.lang.String pMessageType,
                   java.util.Date pStartDate,
                   java.util.Date pEndDate,
                   java.util.Date pExpirationDate)

GearMessage

public GearMessage(GearEnvironment pGearEnv,
                   java.lang.String pMessageType)

GearMessage

public GearMessage(Environment pEnv,
                   java.lang.String pMessageType)
Method Detail

getGearId

public java.lang.String getGearId()
Get the gear item id

Returns:
repository id of the Gear generating the message

setGearId

public void setGearId(java.lang.String pGearId)
Sets the gear item id

Parameters:
pGearId - repository id of the Gear generating the message

getGearName

public java.lang.String getGearName()
Get the transient gear name property for the default locale.

Returns:
name of the Gear generating the message

getGearName

public java.lang.String getGearName(java.util.Locale pLocale)
                             throws java.lang.Exception
Get the transient gear name property based on a locale.

Returns:
locale sensitive name of the Gear generating the message
Throws:
java.lang.Exception

setGearName

public void setGearName(java.lang.String pGearName)
Sets the transient gear name property. This property is transient because persisting the name in the serialized message bean would create two problems. First, the locale of the user viewing the message is not known at the time the message is persisted. Second, the name is dynamic and the message could potentially display an old name if it is persisted. The name is localized by overriding the PortalMeaage.preFormatMessage() method and retrieving the Gear name dynamically and in locale sensitive manner. This method should be called by any AlertHandler implementation prior to formatting the alert message which typically is done in the AlertHandler.alertHandlerAction() method.

Parameters:
pGearName - name of the Gear generating the message

getCommunityId

public java.lang.String getCommunityId()
Get the community item id

Returns:
repository id of the Community where the gear message originated

setCommunityId

public void setCommunityId(java.lang.String pCommunityId)
Set the community item id

Parameters:
pCommunityId - repository id of the Community where the gear message originated

getCommunityName

public java.lang.String getCommunityName()
Get the transient community name property.

Returns:
name of Community where the gear message originated

getCommunityName

public java.lang.String getCommunityName(java.util.Locale pLocale)
                                  throws java.lang.Exception
Get the transient community name property based on a locale.

Returns:
locale sensitive name of the Community where the gear message orignated
Throws:
java.lang.Exception

setCommunityName

public void setCommunityName(java.lang.String pCommunityName)
Sets the transient community name property. This property is transient because persisting the name in the serialized message bean would create two problems. First, the locale of the user viewing the message is not known at the time the message is persisted. Second, the name is dynamic and the message could potentially display an old name if it is persisted The name is localized by overriding PortalMessage.preFormatMessage() and retrieving the Community name dynamically and in locale sensitive manner. This method should be called by any AlertHandler implementation prior to formatting the alert message which typically takes place int the the AlertHandler.alertHandlerAction() method.

Parameters:
pCommunityName - name of Community where the gear message originated

getProfileId

public java.lang.String getProfileId()
Get the profile item id

Returns:
the repository id of the profile

setProfileId

public void setProfileId(java.lang.String pProfileId)
Sets the profile item id

Parameters:
pProfileId - the repository id of the profile

getProfileDisplayName

public java.lang.String getProfileDisplayName()
Get the profile display name

Returns:
the display name of the profile

setProfileDisplayName

public void setProfileDisplayName(java.lang.String pProfileDisplayName)
Sets the profile display name

Parameters:
pProfileDisplayName - the display name of the profile

preFormatMessage

public void preFormatMessage(java.util.Locale pLocale)
                      throws java.lang.Exception
Dynamically retrieve the CommunityName and GearName in a locale sensitive manner prior to the format and delivery of the alert message. This method should be called by any AlertHandler implementation in the method AlertHandle.alertHandlerAction() prior to formatting the alert message.

Overrides:
preFormatMessage in class PortalMessage
Parameters:
pLocale - the Locale that the request to receive alerts came from
Throws:
java.lang.Exception

postFormatMessage

public void postFormatMessage(java.util.Locale pLocale)
                       throws java.lang.Exception
This method should be called by any AlertHandler implementation after formatting and delivery of the alert message. Its purpose is to allow any configuration or special handling of message bean properties that needs to take place after the alert message has been formated and delivered.

Overrides:
postFormatMessage in class PortalMessage
Throws:
java.lang.Exception