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 Object implements ResourceStatus
Implementation of a
ResourceStatusfor 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
EditorResourceStatusconsists 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 classEditorResourceStatus.ActionDefines an action for anEditorResourceStatus.static classEditorResourceStatus.BuilderBuilder class to buildEditorResourceStatusinstances.static classEditorResourceStatus.VariantDefines the possible variants of statuses, in line with CoralUI.Alert variants.
-
Constructor Summary
Constructors Constructor Description EditorResourceStatus(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<EditorResourceStatus.Action>getActions()Returns the actions of this status.Map<String,Object>getAdditionalData()Returns the additional data defined for this status, corresponding to the data that was added usingEditorResourceStatus.Builder.addData(String, Object).Map<String,Object>getData()Returns an unmodifiable map containing the status information and data needed to render this status.StringgetIcon()Returns the name of a CoralUI icon to be displayed in the status.StringgetMessage()Returns the status message.intgetPriority()Returns the priority of this status corresponding to its importance (Integer.MAX_VALUEbeing the highest priority).StringgetResourceSuperType()Returns the resource super type to render this status.StringgetResourceType()Returns the resource type to render this status.StringgetTitle()Returns the title of this status, which describes the module or feature the status is associated with.StringgetType()Returns the type of this status defining the module or feature this status is associated with.EditorResourceStatus.VariantgetVariant()Returns the variant of this status.
-
-
-
Constructor Detail
-
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:
EditorResourceStatus
-
-
Method Detail
-
getType
@Nonnull public String 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:
ResourceStatusProvider.getType()
-
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
@Nullable public Map<String,Object> 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
@Nullable public String getResourceType()
Description copied from interface:ResourceStatusReturns the resource type to render this status.- Specified by:
getResourceTypein interfaceResourceStatus- Returns:
- a resource type or
null
-
getResourceSuperType
@Nullable public String 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
@Nonnull public 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 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 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 Map<String,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 List<EditorResourceStatus.Action> getActions()
Returns the actions of this status.- Returns:
- a list of actions
- See Also:
EditorResourceStatus.Action
-
-