TagLib: Mail

context

Description

Ensures that a mail context is present within the current pageContext. This tag must appear, at least once, before all other tags within the Mail taglib.  If config is not specified, then a search for a useable configuration name is performed in the following fashion:
  1. Attempt to retrieve the current mail configuration name from the page context.  If that succeeds, use it.  If the retrieval fails...
  2. Attempt to retrieve the current mail configuration name from the session.  If that succeeds, store it on the page context and use it.  If the retrieval fails...
  3. From the list of all SSOAdapter configuration names, try to find the first useable mail configuration name.  If that succeeds, store it in the session and page context and use it.  If it is not possible to find a useable mail configuration name, the context tag will fail.
Once a configuration name has been determined, an attempt is made to acquire an appropriate mail context object.  This is done in the following fashion:
  1. Attempt to retrieve a mail context from the page context, and verify it matches the configuration (using the previously acquired configuration name).  If that succeeds, use it.  If that fails...
  2. Attempt to retrieve a mail context from the user's cache of mail contexts.  If that succeeds, store it on the page context and use it.  If the retrieval fails...
  3. Create an SSOAdapter object using the previously acquired configuration name.  Create a mail context, and bind it with the SSOAdapter object.  Store the mail context in the context cache as well as the page context.
In this way, if a mail context has been previously referenced on a page, or within the session, then the config attribute may be omitted, and the most recently referenced context will be retrieved.

Tag Body

JSP or Empty

Restrictions

None.

Attributes

The tag has the following attributes:

Attribute

Description

Req'd?

config
Specifies the "configuration" for which a mail context should be retrieved.
No
test
Permits testing of service availability.  Operates according to the following table:

Service Available:
Service Not Available:
test = "true":
Evaluate tag body.
Skip tag body.
test = "false":
Skip tag body.
Evaluate tag body.

No

Properties

The tag provides the following bean properties:

Property

Description

Type

Access

errorCode
Indicates the error code in case the execution of a command tag fails. Possible values: 
  • Empty error code indicates a generic tag execution failed error.
  • MAIL_001 - Unable to send message because of Invalid email address.
  • MAIL_002 - Unable to send message.
  • MAIL_003 - Attempt to create a folder that already exists.
  • MAIL_004 - Failed to create folder.
- Empty error code indicates a generic tag execution failed error.
- MAIL_001 - Unable to send message because of Invalid email address
- MAIL_002 - Unable to send message.

String
Get
inboxNumMsgs Number of messages in the INBOX. Integer
Get
inboxNumUnreadMsgs Number of unread messages in the INBOX. Integer
Get
inboxNumNewMsgs Number of new messages in the INBOX. Integer
Get
numMsgs Number of messages in the current folder. Integer
Get
numUnreadMsgs Number of unread messages in the current folder. Integer
Get
numNewMsgs Number of new messages in the current folder. Integer
Get
signature User's predefined signature. String
Get
atmsgend A boolean that indicates if there is a message following the message from which was fetched the current lines collection. Boolean
Get
atmsgstart A boolean that indicates if there is a message prior to the message from which was fetched the current lines collection. Boolean
Get
nextmsgidx The index of the message following the message from which was fetched the current lines collection. Integer
Get
prevmsgidx The index of the message prior to the message from which was fetched the current lines collection. Integer
Get
presetEmpty A boolean that indicates whether or not the user has any predefined messages. Boolean
Get
doMsgInclude A boolean that indicates whether or not to include the original message within a reply message. Boolean
Set
includeSig A boolean that indicates whether or not to append the user's signature onto an outgoing message sent with sendmessage. Boolean
Set
   
 

Example(s)

<%-- example of context tag usage --%>
<mail:context/> ... <mail:context> <p>New Message: <mail:get property="inboxNumNewMsgs"/> </mail:context>