LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyMailController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyUserInputController
              extended by leon.control.LyMailController
All Implemented Interfaces:
LyGetSessionInterface, LyContextInterface, LyGetActionInterface, LySelectFileListenerInterface, LyGuiListener, LyInfoListener, LyEvaluator, LyDemandListener

public class LyMailController
extends LyUserInputController

This class implements a sending email input dialog/window to ask the requested values from the user. This controller is associated with a builder (LyMailBuilder) and a behavior (LyMailBehavior) that implements LyMailBehaviorInterface.


Field Summary
static java.lang.String __VERSION
          File Version
static java.lang.String ATTACHED_FILE
          Form field identifier: a file that can be sent with the email message.
static java.lang.String AUTH_LOGIN
          Form field identifier: smtp user name for authentication.
static java.lang.String AUTH_PASSWORD
          Form field identifier: smtp password for authentication.
static java.lang.String AUTH_REALM
          Form field identifier: smtp realm for CRAM-MD5 authentication.
static java.lang.String AUTHENTICATION
          Form field identifier: smtp server requires authentication.
static java.lang.String FROM_MAIL_ADDRESS
          Form field identifier: email address of the sender.
static java.lang.String FROM_USER_NAME
          Form field identifier: user name of the sender.
static java.lang.String HTML_MESSAGE
          Form field identifier: a file that contains the HTML content of the email message.
static java.lang.String MAIL_PREVIEW_CONTENT
          Form field identifier: the generated content of a consultation email message.
static java.lang.String MAIL_PREVIEW_SENDER
          Form field identifier: the generated name of the sender, with its email address.
static java.lang.String MAIL_PREVIEW_SUBJECT
          Form field identifier: the generated subject of a consultation email message.
static java.lang.String MAIL_SUBJECT
          Form field identifier: email subject field.
static java.lang.String RAW_MESSAGE
          Form field identifier: the unformatted email message.
static java.lang.String RECIPIENT_USER_CLASS
          Form field identifier: the class that holds the receivers' users as objects.
static java.lang.String RECIPIENT_USER_FIELD
          Form field identifier: the field of the class that contains the email address.
static java.lang.String SELECTED_RECIPIENTS
          Form field identifier: the relation field that holds the recipient users.
static java.lang.String SEND_SELECTED
          Form field identifier: sets the controller to send the selected objects or use the selected objects as the receivers.
static java.lang.String SMTP_PORT
          Form field identifier: server port to use for the connection.
static java.lang.String SMTP_SERVER
          Form field identifier: smtp server to send the email message.
 
Fields inherited from class leon.control.LyAreaController
DEFAULT_MENU_ITEM_IMAGE_SIZE, DEMAND_APPLY, DEMAND_CANCEL, DEMAND_CLOSE, DEMAND_CREATE_CHART, DEMAND_DELETE_CHART, DEMAND_DELETE_OBJECTINFOS, DEMAND_DELETE_PREFERENCE, DEMAND_UPDATE_VIEW, DEMAND_VALIDATE
 
Fields inherited from class leon.control.LyController
_nbControllers, _nextId, CONTROLLER_ID_SEP, DEFAULT_IMAGE_FORMAT, DEMAND_HELP, ID_SEP
 
Constructor Summary
LyMailController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList context)
          This constructor creates a new LyMailController object.
LyMailController(LySession session, LyController parent, LyAction action, LyObjectList context)
          This constructor creates a new LyMailController object.
 
Method Summary
 java.io.File getAttachedFile()
          Accessor to the attached file of the custom email message.
 boolean getAuthentication()
          Accessor to the authentication parameter.
 java.lang.String getAuthLogin()
          Accessor to the login used on SMTP authentication.
 java.lang.String getAuthPassword()
          Accessor to the password used on SMTP authentication.
 java.lang.String getAuthRealm()
          Accessor to the realm used on CRAM-MD5 authentication.
 java.lang.Class<?> getBehaviorInterface()
          Method that gives the interface that must be implemented by the behavior associated to this controller.
 java.lang.String getFromAddress()
          Accessor to the email address of the sender.
 java.lang.String getFromUserName()
          Accessor to the user name of the sender.
 java.lang.String getGeneratedHtmlContent()
          Generates a formatted message content that represents the selected objects.
 java.lang.String getGeneratedRawContent()
          Generates the textual content of a generated email message.
 java.lang.String getGeneratedSender()
          Generates the sender name of an email message using the given user name and email address in the meta-model.
 java.lang.String getGeneratedSubject()
          Generates the subject of an email message when the selected objects are sent to multiple recipients.
 java.io.File getHtmlMessage()
          Accessor to the file that contains the formatted part of the custom email message.
 java.lang.String getRawMessage()
          Accessor to the raw message of the custom email message.
 int getSmtpPort()
          Accessor to the SMTP port number.
 java.lang.String getSmtpServer()
          Accessor to the SMTP server address.
 java.lang.String getSubject()
          Accessor to the subject of a custom email message.
 java.lang.String getToUserClass()
          Accessor to the identifier of the class that contains the recipients for the email message.
 java.lang.String getToUserField()
          Accessor to the identifier of the field that contains the email addresses for the email message's recipients.
 boolean isSendSelected()
          Indicates that the selected objects have to be sent.
 void sendMail()
          Sends a message associated to the given objects.
 void showView()
          Make the view visible to the user.
 void validateMail()
          Checks every aspect of all the values already retrieved with retrieveValues() and generates the appropriate error if some values are missing.
 
Methods inherited from class leon.control.LyUserInputController
actionDemand, addBoolean, addBoolean, addChoice, addChoice, addDate, addDate, addFile, addFile, addLabel, addLabel, addList, addList, addNumber, addNumber, addRelation, addRelation, addText, addText, addText, getClassInfo, getComponent, getFormComponent, getImage, getInputId, getTitleBar, getViewController, isDialog, isViewResizable, reset, setBehavior, setBuilder, setDialog, setImage, setInputId, setTitleBar
 
Methods inherited from class leon.control.LyAreaController
canClose, canFree, clearViewCache, completeMenuBar, completeMessages, free, free, getAction, getAreaStackController, getBehavior, getBuilder, getContent, getContext, getContextClient, getContextTitle, getDefaultAction, getEnvironment, getFastEditionAction, getHelpFile, getImageTooltip, getInfoLabel, getInfoLabel, getKeyValue, getLabel, getLastModified, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getRefreshTime, getSelection, getShortLabel, getTarget, getTitle, getViewController, hasMark, hasNotMark, hasViewController, hideView, infoEvent, initialize, isInitialized, isOutlined, menuDemand, reset, selectFileDemand, setContext, setContext, setContextClient, setIdle, setPreference, setViewController, showView, testParameter, toString, update, updateTitleBar
 
Methods inherited from class leon.control.LyController
activateViewDemand, demandPerformed, dragDropDemand, getApplication, getClassInfo, getId, getImage, getImage, getImage, getImage, getImageFromPrefix, getImageFromPrefix, getImageFromPrefix, getName, getObjectId, getSession, getUserData, getView, getViewManager, helpDemand, hideView, isFreed, isIdle, selectionDemand, setBuilderClass, setLastModified, setName, setUserData, showError, showError, showWarning, updateViewFromValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File Version

See Also:
Constant Field Values

SMTP_SERVER

public static final java.lang.String SMTP_SERVER
Form field identifier: smtp server to send the email message.


SMTP_PORT

public static final java.lang.String SMTP_PORT
Form field identifier: server port to use for the connection.


AUTHENTICATION

public static final java.lang.String AUTHENTICATION
Form field identifier: smtp server requires authentication.


AUTH_LOGIN

public static final java.lang.String AUTH_LOGIN
Form field identifier: smtp user name for authentication.


AUTH_PASSWORD

public static final java.lang.String AUTH_PASSWORD
Form field identifier: smtp password for authentication.


AUTH_REALM

public static final java.lang.String AUTH_REALM
Form field identifier: smtp realm for CRAM-MD5 authentication.


SEND_SELECTED

public static final java.lang.String SEND_SELECTED
Form field identifier: sets the controller to send the selected objects or use the selected objects as the receivers.


MAIL_SUBJECT

public static final java.lang.String MAIL_SUBJECT
Form field identifier: email subject field.


FROM_USER_NAME

public static final java.lang.String FROM_USER_NAME
Form field identifier: user name of the sender.


FROM_MAIL_ADDRESS

public static final java.lang.String FROM_MAIL_ADDRESS
Form field identifier: email address of the sender.


RECIPIENT_USER_CLASS

public static final java.lang.String RECIPIENT_USER_CLASS
Form field identifier: the class that holds the receivers' users as objects.


RECIPIENT_USER_FIELD

public static final java.lang.String RECIPIENT_USER_FIELD
Form field identifier: the field of the class that contains the email address.


SELECTED_RECIPIENTS

public static final java.lang.String SELECTED_RECIPIENTS
Form field identifier: the relation field that holds the recipient users.


ATTACHED_FILE

public static final java.lang.String ATTACHED_FILE
Form field identifier: a file that can be sent with the email message.


HTML_MESSAGE

public static final java.lang.String HTML_MESSAGE
Form field identifier: a file that contains the HTML content of the email message.


RAW_MESSAGE

public static final java.lang.String RAW_MESSAGE
Form field identifier: the unformatted email message.


MAIL_PREVIEW_SENDER

public static final java.lang.String MAIL_PREVIEW_SENDER
Form field identifier: the generated name of the sender, with its email address.


MAIL_PREVIEW_SUBJECT

public static final java.lang.String MAIL_PREVIEW_SUBJECT
Form field identifier: the generated subject of a consultation email message.


MAIL_PREVIEW_CONTENT

public static final java.lang.String MAIL_PREVIEW_CONTENT
Form field identifier: the generated content of a consultation email message.

Constructor Detail

LyMailController

public LyMailController(LySession session,
                        LyController parent,
                        LyAction action,
                        LyObjectList context)
This constructor creates a new LyMailController object.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller). Controller hierarchy indicates a child controller (for example a dialog created from a main view)
action - related action. If an action is specified, the controller uses action parameters (action name, action specific XML view description ...)
context - current context (may be null if the view is not contextual to a list of objects).

LyMailController

public LyMailController(LySession session,
                        LyController parent,
                        LyAction action,
                        LyClassInfo classInfo,
                        LyObjectList context)
This constructor creates a new LyMailController object.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller). Controller hierarchy indicates a child controller (for example a dialog created from a main view)
action - related action. If an action is specified, the controller uses action parameters (action name, action specific XML view description ...)
classInfo - This parameter is not used. Kept from introspection compatibility.
context - current context (may be null if the view is not contextual to a list of objects).
Method Detail

getBehaviorInterface

public java.lang.Class<?> getBehaviorInterface()
Description copied from class: LyUserInputController
Method that gives the interface that must be implemented by the behavior associated to this controller.

Overrides:
getBehaviorInterface in class LyUserInputController
Returns:
Class representing the behavior interface of this controller.
See Also:
LyUserInputController.getBehaviorInterface()

validateMail

public void validateMail()
Checks every aspect of all the values already retrieved with retrieveValues() and generates the appropriate error if some values are missing.


sendMail

public void sendMail()
Sends a message associated to the given objects. If the _sendSelected attribute is true, then the given objects will be sent through the LyMailBehavior.sendMail(LyMailController, LyClassInfo, LyFieldInfo, LyObjectList) method. Else the objects will specify email users to send a custom email message with the LyMailBehavior.sendMail(LyMailController, LyObjectList, LyFieldInfo) method.


getGeneratedSubject

public java.lang.String getGeneratedSubject()
Generates the subject of an email message when the selected objects are sent to multiple recipients. In this case, the subject will be based on the number of selected items as well as the associated classes, or simply its name if the object is unique.

Returns:
a String resuming the selected objects content

getGeneratedRawContent

public java.lang.String getGeneratedRawContent()
Generates the textual content of a generated email message. This message will be a list of all the object's fields that appear in consultation.

Returns:
a String containing the consultation text of the objects.

getGeneratedHtmlContent

public java.lang.String getGeneratedHtmlContent()
Generates a formatted message content that represents the selected objects.

Returns:
a String that has HTML content for the representation of the objects to be sent

getGeneratedSender

public java.lang.String getGeneratedSender()
Generates the sender name of an email message using the given user name and email address in the meta-model.

Returns:
a String representing an email address with its associated name

showView

public void showView()
Description copied from class: LyAreaController
Make the view visible to the user.

Overrides:
showView in class LyAreaController
See Also:
LyAreaController.showView()

getAuthentication

public boolean getAuthentication()
Accessor to the authentication parameter.

Returns:
true if the SMTP server needs authentication, false otherwise.

getAuthLogin

public java.lang.String getAuthLogin()
Accessor to the login used on SMTP authentication.

Returns:
the SMTP authentication login

getAuthPassword

public java.lang.String getAuthPassword()
Accessor to the password used on SMTP authentication.

Returns:
the SMTP authentication password

getAuthRealm

public java.lang.String getAuthRealm()
Accessor to the realm used on CRAM-MD5 authentication.

Returns:
the authentication realm

getSmtpServer

public java.lang.String getSmtpServer()
Accessor to the SMTP server address.

Returns:
the SMTP server address, either at a full name or as an IP

getSmtpPort

public int getSmtpPort()
Accessor to the SMTP port number.

Returns:
the port number used for SMTP connection. By default, it is 25.

getFromUserName

public java.lang.String getFromUserName()
Accessor to the user name of the sender.

Returns:
the name of the sending user. This value may be null or empty.

getFromAddress

public java.lang.String getFromAddress()
Accessor to the email address of the sender.

Returns:
the email address of the sending user. This value may be null or empty.

getToUserClass

public java.lang.String getToUserClass()
Accessor to the identifier of the class that contains the recipients for the email message.

Returns:
a class identifier

getToUserField

public java.lang.String getToUserField()
Accessor to the identifier of the field that contains the email addresses for the email message's recipients.

Returns:
a field identifier

getSubject

public java.lang.String getSubject()
Accessor to the subject of a custom email message.

Returns:
the subject field of the custom message to send. This value may be null or empty.

getRawMessage

public java.lang.String getRawMessage()
Accessor to the raw message of the custom email message.

Returns:
the text for the unformatted part of the custom email message.

getHtmlMessage

public java.io.File getHtmlMessage()
Accessor to the file that contains the formatted part of the custom email message.

Returns:
a file with HTML content.

getAttachedFile

public java.io.File getAttachedFile()
Accessor to the attached file of the custom email message.

Returns:
a file that is associated to the email message and that is sent as part of the message.

isSendSelected

public boolean isSendSelected()
Indicates that the selected objects have to be sent.

Returns:
true if the selected objects are sent, false if the selected objects represents users to send a message

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com