coldbox.system.plugins

Class MessageBox

WEB-INF.cftags.component
        extended by coldbox.system.FrameworkSupertype
            extended by coldbox.system.Plugin
                extended by coldbox.system.plugins.MessageBox
Class Attributes:
  • cache : true
  •  
  • output : false
  •  

    This is the MessageBox plugin. It uses the session/client scope to save messages.

    Property Summary
    type property default serializable required
    any JSON


    • inject = coldbox:plugin:JSON
    true false
    Constructor Summary
    init(any controller)
          Constructor.
    Method Summary
    void addData(string key, string value)
         Add data that can be used for arbitrary stuff.
    void append(string message)
         Append a message to the MessageBox.
    void appendArray(Array messageArray)
         Append an array of messages to the MessageBox.
    void clearMessage()
         Clears the message structure by deleting it from the session scope.
    void error([string message=''], [Array messageArray])
         Facade to setmessage with error type.
    private any flattenMessageArray(Array messageArray)
    array getData([boolean clearData='true'])
         Add data that can be used for arbitrary stuff.
    string getDataJSON([boolean clearData='true'])
         Get the data as JSON.
    any getMessage()
         Returns a structure of the message if it exists, else a blank structure.
    void info([string message=''], [Array messageArray])
         Facade to setmessage with info type.
    boolean isEmptyMessage()
         Checks wether the MessageBox is empty or not.
    private string isValidMessageType(string type)
         Returns a list of valid message types.
    void prependArray(Array messageArray)
         Prepend an array of messages to the MessageBox.
    void putData(array theData)
         Add data that can be used for arbitrary stuff.
    any renderMessage(string type, [string message=''], [Array messageArray], [string template=''])
         Renders a messagebox immediately for you with the passed in arguments.
    any renderit([boolean clearMessage='true'], [string template=''])
         Renders the message box and clears the message structure by default.
    void setMessage(string type, [string message=''], [Array messageArray])
         Create a new MessageBox.
    void warn([string message=''], [Array messageArray])
         Facade to setmessage with warning type.
     
    Methods inherited from class coldbox.system.Plugin
    getPluginDescription, getPluginName, getPluginVersion, getRequestCollection, getRequestContext, getpluginAuthor, getpluginAuthorURL, getpluginPath, setPluginDescription, setPluginName, setPluginVersion, setpluginAuthor, setpluginAuthorURL
     
    Methods inherited from class coldbox.system.FrameworkSupertype
    $abort, $dump, $htmlhead, $include, $rethrow, $throw, addAsset, announceInterception, getColdboxOCM, getController, getDatasource, getDebugMode, getInterceptor, getMailService, getMailSettings, getMemento, getModel, getModuleSettings, getMyPlugin, getNewMail, getPlugin, getResource, getSetting, getSettingStructure, getSettingsBean, getValidationManager, getfwLocale, includeUDF, loadGlobalUDFLibraries, locateDirectoryPath, locateFilePath, persistVariables, populateModel, relocate, renderExternalView, renderLayout, renderView, runEvent, setDebugMode, setNextEvent, setNextRoute, setSetting, setfwLocale, settingExists, validateModel
     
    Methods inherited from class WEB-INF.cftags.component
    None

    Constructor Detail

    init

    public init(any controller)

    Constructor

    Parameters:
    controller - coldbox.system.web.Controller

    Property Detail

    JSON

    property any JSON

    Attributes:
    inject - coldbox:plugin:JSON
    required - false
    serializable - true

    Method Detail

    addData

    public void addData(string key, string value)

    Add data that can be used for arbitrary stuff

    Parameters:
    key
    value

    append

    public void append(string message)

    Append a message to the MessageBox. If there is no message, then it sets the type to information.

    Parameters:
    message - The message to append, it does not include any breaks or delimiters. You must send that.

    appendArray

    public void appendArray(Array messageArray)

    Append an array of messages to the MessageBox. If there is no message, then it sets the type to information.

    Parameters:
    messageArray - The array of messages to append. You must send that.

    clearMessage

    public void clearMessage()

    Clears the message structure by deleting it from the session scope.


    error

    public void error([string message=''], [Array messageArray])

    Facade to setmessage with error type

    Parameters:
    message - The message to show.
    messageArray - You can also send in an array of messages to render separated by a

    flattenMessageArray

    private any flattenMessageArray(Array messageArray)

    Parameters:
    messageArray - Array of messages to flatten

    getData

    public array getData([boolean clearData='true'])

    Add data that can be used for arbitrary stuff

    Parameters:
    clearData - Flag to clear the data structure or not after rendering. Default is true.

    getDataJSON

    public string getDataJSON([boolean clearData='true'])

    Get the data as JSON

    Parameters:
    clearData - Flag to clear the data structure or not after rendering. Default is true.

    getMessage

    public any getMessage()

    Returns a structure of the message if it exists, else a blank structure.


    info

    public void info([string message=''], [Array messageArray])

    Facade to setmessage with info type

    Parameters:
    message - The message to show.
    messageArray - You can also send in an array of messages to render separated by a

    isEmptyMessage

    public boolean isEmptyMessage()

    Checks wether the MessageBox is empty or not.


    isValidMessageType

    private string isValidMessageType(string type)

    Returns a list of valid message types.

    Parameters:
    type

    prependArray

    public void prependArray(Array messageArray)

    Prepend an array of messages to the MessageBox. If there is no message, then it sets the type to information.

    Parameters:
    messageArray - The array of messages to append. You must send that.

    putData

    public void putData(array theData)

    Add data that can be used for arbitrary stuff

    Parameters:
    theData

    renderMessage

    public any renderMessage(string type, [string message=''], [Array messageArray], [string template=''])

    Renders a messagebox immediately for you with the passed in arguments

    Parameters:
    type - The message type.Available types [error][warning][info]
    message - The message to show.
    messageArray - You can also send in an array of messages to render separated by a
    template - An optional template to use for rendering instead of core or setting

    renderit

    public any renderit([boolean clearMessage='true'], [string template=''])

    Renders the message box and clears the message structure by default.

    Parameters:
    clearMessage - Flag to clear the message structure or not after rendering. Default is true.
    template - An optional template to use for rendering instead of core or setting

    setMessage

    public void setMessage(string type, [string message=''], [Array messageArray])

    Create a new MessageBox. Look at types.

    Parameters:
    type - The message type.Available types [error][warning][info]
    message - The message to show.
    messageArray - You can also send in an array of messages to render separated by a

    warn

    public void warn([string message=''], [Array messageArray])

    Facade to setmessage with warning type

    Parameters:
    message - The message to show.
    messageArray - You can also send in an array of messages to render separated by a