Package com.day.cq.wcm.commons.status
Class EditorResourceStatus
java.lang.Object
com.day.cq.wcm.commons.status.EditorResourceStatus
- All Implemented Interfaces:
ResourceStatus
Implementation of a ResourceStatus for resources that are authored in the Editor
(such as pages or templates). EditorResourceStatuses are retrieved and displayed in a
status bar in the Editor.
An EditorResourceStatus consists of the following information:
- A title describing the module or feature the status is associated with
- A message containing the status information
- A priority (see
ResourceStatus.getPriority()) - A variant describing the nature of the status (see
EditorResourceStatus.Variant) - An icon (optional, see
getIcon()) - A list of actions rendered as clickable links (optional, see
EditorResourceStatus.Action) - Additional data associated with the status (optional)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDefines an action for anEditorResourceStatus.static classBuilder class to buildEditorResourceStatusinstances.static enumDefines the possible variants of statuses, in line with CoralUI.Alert variants. -
Constructor Summary
ConstructorsConstructorDescriptionEditorResourceStatus(String type, String title, String message, Integer priority, EditorResourceStatus.Variant variant, String icon, List<EditorResourceStatus.Action> actions, Map<String, Object> data) Creates a status. -
Method Summary
Modifier and TypeMethodDescriptionReturns the actions of this status.Returns the additional data defined for this status, corresponding to the data that was added usingEditorResourceStatus.Builder.addData(String, Object).getData()Returns an unmodifiable map containing the status information and data needed to render this status.getIcon()Returns the name of a CoralUI icon to be displayed in the status.Returns the status message.intReturns the priority of this status corresponding to its importance (Integer.MAX_VALUEbeing the highest priority).Returns the resource super type to render this status.Returns the resource type to render this status.getTitle()Returns the title of this status, which describes the module or feature the status is associated with.getType()Returns the type of this status defining the module or feature this status is associated with.Returns the variant of this status.
-
Constructor Details
-
EditorResourceStatus
public EditorResourceStatus(@Nonnull String type, @Nonnull String title, @Nonnull String message, @Nullable Integer priority, @Nullable EditorResourceStatus.Variant variant, @Nullable String icon, @Nullable List<EditorResourceStatus.Action> actions, @Nullable Map<String, Object> data) Creates a status.- Parameters:
type- the status type (seeResourceStatus.getType())title- the titlemessage- the messagepriority- the priority ornullvariant- the variant ornullicon- the icon ornullactions- a list of actions ornulldata- additional status data ornull- See Also:
-
-
Method Details
-
getType
Description copied from interface:ResourceStatusReturns the type of this status defining the module or feature this status is associated with.- Specified by:
getTypein interfaceResourceStatus- Returns:
- the status type
- See Also:
-
getPriority
public int getPriority()Description copied from interface:ResourceStatusReturns the priority of this status corresponding to its importance (Integer.MAX_VALUEbeing the highest priority).- Specified by:
getPriorityin interfaceResourceStatus- Returns:
- the status priority
-
getData
Description copied from interface:ResourceStatusReturns an unmodifiable map containing the status information and data needed to render this status.- Specified by:
getDatain interfaceResourceStatus- Returns:
- a map containing key/value pairs
-
getResourceType
Description copied from interface:ResourceStatusReturns the resource type to render this status.- Specified by:
getResourceTypein interfaceResourceStatus- Returns:
- a resource type or
null
-
getResourceSuperType
Description copied from interface:ResourceStatusReturns the resource super type to render this status.- Specified by:
getResourceSuperTypein interfaceResourceStatus- Returns:
- a resource super type or
null
-
getTitle
Returns the title of this status, which describes the module or feature the status is associated with. In contrast to the the status type (seegetType()), the title is meant to be displayed in the user interface.- Returns:
- the status title
-
getMessage
Returns the status message.- Returns:
- the status message
-
getVariant
Returns the variant of this status.- Returns:
- the status variant
- See Also:
-
getIcon
Returns the name of a CoralUI icon to be displayed in the status. If no icon is set, then a default icon is assumed (depending on the specifiedEditorResourceStatus.Variant).- Returns:
- the status icon or
null
-
getAdditionalData
Returns the additional data defined for this status, corresponding to the data that was added usingEditorResourceStatus.Builder.addData(String, Object). In contrast,getData()returns a map containing all information defining this status (i.e. including title, message etc).- Returns:
- the additional data of this status
-
getActions
Returns the actions of this status.- Returns:
- a list of actions
- See Also:
-