Class: Message

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

QuickNav

Fields


Message

Version:
  • 7.1.0
Since:
  • 0.6.0
Module:
  • ojmessaging

Module usage

See JET Module Loading for an overview of module usage within JET.

Javascript Import Format
define(['ojs/ojmessaging'], function(Message) {
 // Application should call API on Message 
})
Typescript Import Format
//This class is exported directly as module. To import it
import Message= require("ojs/ojmessaging");

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.

Constructor

new Message(summary, detail, severity)

Constructs a message object.

NOTE: Instead of using the constructor, please use an Object that duck-types oj.Message - has summary, detail, and severity properties. Creating an oj.Message Object provides no additional value than the duck-typed Object.

Parameters:
Name Type Argument Description
summary string Localized summary message text
detail string Localized detail message text
severity oj.Message.SEVERITY_TYPE | Message.SEVERITY_LEVEL <optional>
An optional severity for this message. Use constants oj.Message.SEVERITY_LEVEL for number types and oj.Message.SEVERITY_TYPE for string types. Default is SEVERITY_ERROR if no severity is specified

Fields

(static) SEVERITY_LEVEL :number

Message severity level
Properties:
Name Type Default
FATAL number 5
ERROR number 4
WARNING number 3
INFO number 2
CONFIRMATION number 1

(static) SEVERITY_TYPE :string

Indicates the type of severity that the message represents.
Properties:
Name Type Default Description
CONFIRMATION string confirmation Indicates a confirmation that an operation or task was completed. This is the lowest severity level.
INFO string info Indicates information or operation messages. This has a lower severity level than warning.
WARNING string warning Indicates an application condition or situation that might require users' attention. This has a lower severity than error.
ERROR string error Used when data inaccuracies occur when completing a field and that needs fixing before user can continue. This has a lower severity level than fatal. fatal.
FATAL string fatal Used when a critical application error or an unknown failure occurs. This is the highest severity level.

detail :string

Localized detail text.
Default Value:
  • ""

severity :(oj.Message.SEVERITY_TYPE|oj.Message.SEVERITY_LEVEL)

Severity type of message. See oj.Message.SEVERITY_TYPE for string types and oj.Message.SEVERITY_LEVEL for number types.
Default Value:
  • oj.Message.SEVERITY_TYPE.ERROR

summary :string

Localized summary text.
Default Value:
  • ""

Methods

(static) getMaxSeverity(messages) → {Message.SEVERITY_LEVEL| -1}

Returns the max severity level in a array of message objects.
Parameters:
Name Type Argument Description
messages Array.<oj.Message> <optional>
an array of message instances or duck typed messages
Returns:
-1 if none can be determined; otherwise a severity level as defined by oj.Message.SEVERITY_LEVEL.
Type
Message.SEVERITY_LEVEL| -1

(static) getSeverityLevel(severity) → {oj.Message.SEVERITY_LEVEL}

A convenience method that returns the severity level when given either a severity level of type number or a severity type of string. If severity level is not provided or is not valid this returns a severity error.
Parameters:
Name Type Argument Description
severity oj.Message.SEVERITY_TYPE | oj.Message.SEVERITY_LEVEL <optional>
Returns:
Type
oj.Message.SEVERITY_LEVEL

(static) getSeverityType(level) → {oj.Message.SEVERITY_TYPE}

A convenience method that returns the severity type when given either a severity level of type number or a severity type of string. If severity level is not provided or is not valid this return a severity error.
Parameters:
Name Type Argument Description
level oj.Message.SEVERITY_TYPE | oj.Message.SEVERITY_LEVEL <optional>
Returns:
Type
oj.Message.SEVERITY_TYPE

(static) isValid(messages) → {boolean}

Returns false if messages are of severity error or greater.
Parameters:
Name Type Description
messages Array.<oj.Message> an array of message instances or duck-typed messages
Returns:
true if none of the messages are of severity error or greater. false otherwise
Type
boolean