Package com.day.cq.wcm.commons.status
Class EditorResourceStatus
- java.lang.Object
-
- com.day.cq.wcm.commons.status.EditorResourceStatus
-
- All Implemented Interfaces:
ResourceStatus
public class EditorResourceStatus extends java.lang.Object implements ResourceStatus
Implementation of a
ResourceStatus
for resources that are authored in the Editor (such as pages or templates).EditorResourceStatus
es 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:
com.adobe.granite.resourcestatus
,ResourceStatus
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EditorResourceStatus.Action
Defines an action for anEditorResourceStatus
.static class
EditorResourceStatus.Builder
Builder class to buildEditorResourceStatus
instances.static class
EditorResourceStatus.Variant
Defines the possible variants of statuses, in line with CoralUI.Alert variants.
-
Constructor Summary
Constructors Constructor Description EditorResourceStatus(java.lang.String type, java.lang.String title, java.lang.String message, java.lang.Integer priority, EditorResourceStatus.Variant variant, java.lang.String icon, java.util.List<EditorResourceStatus.Action> actions, java.util.Map<java.lang.String,java.lang.Object> data)
Creates a status.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<EditorResourceStatus.Action>
getActions()
Returns the actions of this status.java.util.Map<java.lang.String,java.lang.Object>
getAdditionalData()
Returns the additional data defined for this status, corresponding to the data that was added usingEditorResourceStatus.Builder.addData(String, Object)
.java.util.Map<java.lang.String,java.lang.Object>
getData()
Returns an unmodifiable map containing the status information and data needed to render this status.java.lang.String
getIcon()
Returns the name of a CoralUI icon to be displayed in the status.java.lang.String
getMessage()
Returns the status message.int
getPriority()
Returns the priority of this status corresponding to its importance (Integer.MAX_VALUE
being the highest priority).java.lang.String
getResourceSuperType()
Returns the resource super type to render this status.java.lang.String
getResourceType()
Returns the resource type to render this status.java.lang.String
getTitle()
Returns the title of this status, which describes the module or feature the status is associated with.java.lang.String
getType()
Returns the type of this status defining the module or feature this status is associated with.EditorResourceStatus.Variant
getVariant()
Returns the variant of this status.
-
-
-
Constructor Detail
-
EditorResourceStatus
public EditorResourceStatus(@Nonnull java.lang.String type, @Nonnull java.lang.String title, @Nonnull java.lang.String message, @Nullable java.lang.Integer priority, @Nullable EditorResourceStatus.Variant variant, @Nullable java.lang.String icon, @Nullable java.util.List<EditorResourceStatus.Action> actions, @Nullable java.util.Map<java.lang.String,java.lang.Object> data)
Creates a status.- Parameters:
type
- the status type (seeResourceStatus.getType()
)title
- the titlemessage
- the messagepriority
- the priority ornull
variant
- the variant ornull
icon
- the icon ornull
actions
- a list of actions ornull
data
- additional status data ornull
- See Also:
EditorResourceStatus
-
-
Method Detail
-
getType
@Nonnull public java.lang.String getType()
Description copied from interface:ResourceStatus
Returns the type of this status defining the module or feature this status is associated with.- Specified by:
getType
in interfaceResourceStatus
- Returns:
- the status type
- See Also:
ResourceStatusProvider.getType()
-
getPriority
public int getPriority()
Description copied from interface:ResourceStatus
Returns the priority of this status corresponding to its importance (Integer.MAX_VALUE
being the highest priority).- Specified by:
getPriority
in interfaceResourceStatus
- Returns:
- the status priority
-
getData
@Nullable public java.util.Map<java.lang.String,java.lang.Object> getData()
Description copied from interface:ResourceStatus
Returns an unmodifiable map containing the status information and data needed to render this status.- Specified by:
getData
in interfaceResourceStatus
- Returns:
- a map containing key/value pairs
-
getResourceType
@Nullable public java.lang.String getResourceType()
Description copied from interface:ResourceStatus
Returns the resource type to render this status.- Specified by:
getResourceType
in interfaceResourceStatus
- Returns:
- a resource type or
null
-
getResourceSuperType
@Nullable public java.lang.String getResourceSuperType()
Description copied from interface:ResourceStatus
Returns the resource super type to render this status.- Specified by:
getResourceSuperType
in interfaceResourceStatus
- Returns:
- a resource super type or
null
-
getTitle
@Nonnull public java.lang.String 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
public java.lang.String getMessage()
Returns the status message.- Returns:
- the status message
-
getVariant
@Nonnull public EditorResourceStatus.Variant getVariant()
Returns the variant of this status.- Returns:
- the status variant
- See Also:
EditorResourceStatus.Variant
-
getIcon
@Nullable public java.lang.String 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
@Nonnull public java.util.Map<java.lang.String,java.lang.Object> 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
@Nonnull public java.util.List<EditorResourceStatus.Action> getActions()
Returns the actions of this status.- Returns:
- a list of actions
- See Also:
EditorResourceStatus.Action
-
-