Class SuccessResponse
java.lang.Object
com.broadleafcommerce.metadata.dsl.core.AbstractComponent<SuccessResponse>
com.broadleafcommerce.metadata.dsl.core.SuccessResponse
- All Implemented Interfaces:
Component<SuccessResponse>,Copyable<SuccessResponse>,Form<SuccessResponse>,Serializable,Comparable<SuccessResponse>
public class SuccessResponse
extends AbstractComponent<SuccessResponse>
implements Form<SuccessResponse>, Serializable, Copyable<SuccessResponse>
Defines the metadata configuration for handling a successful API response from an
Action.
This is specifically designed to support the "One-Time Success" pattern, where sensitive data (like generated API keys or secrets) is returned in the API response payload only once and must be presented to the user securely before being discarded.
Implements Form to support all standard out-of-the-box form-building methods (like
Form.addField(java.lang.String, com.broadleafcommerce.metadata.dsl.core.Field<?>), Form.addGroup(java.lang.String, com.broadleafcommerce.metadata.dsl.core.Group<?>), and field(java.lang.String, com.broadleafcommerce.metadata.dsl.core.Field<?>)).
- Since:
- Metadata Service 2.0.9, Release Train 2.3.1
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines how the success response should be presented to the user.static enumstatic enumDefines the redirection or reload behavior to trigger after the user closes the success view. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancopy()displayMode(String displayMode) Fluently sets how the success response should be presented to the user.booleanFluently adds a field definition for extracting and rendering a property from the API response, mapping it to a specific response property path.How the success response should be presented to the user.The styling to apply to the message.The action to perform after the user closes the success response view.inthashCode()booleanIf true, forces the user to explicitly click a close button to dismiss the view, preventing accidental dismissal (e.g., via clicking the backdrop or hitting the Escape key).message(InternationalizedMessage message) Fluently sets the localized message or instructions (maps todescriptionof the Component) to display in the success view.Fluently sets the localized message or instructions (maps todescriptionof the Component) to display in the success view.messageStyle(String messageStyle) Fluently sets the styling to apply to the message.onCloseRedirect(String onCloseRedirect) Sets the action to perform after the user closes the success view.requireExplicitClose(boolean requireExplicitClose) Fluently sets whether the user must explicitly click a close button to dismiss the view.voidsetDisplayMode(String displayMode) How the success response should be presented to the user.voidsetMessageStyle(String messageStyle) The styling to apply to the message.voidsetOnCloseRedirect(String onCloseRedirect) The action to perform after the user closes the success response view.voidsetRequireExplicitClose(boolean requireExplicitClose) If true, forces the user to explicitly click a close button to dismiss the view, preventing accidental dismissal (e.g., via clicking the backdrop or hitting the Escape key).title(InternationalizedMessage title) Fluently sets the localized title (maps tolabelof the Component) to display in the success view.Fluently sets the localized title (maps tolabelof the Component) to display in the success view.toString()Methods inherited from class com.broadleafcommerce.metadata.dsl.core.AbstractComponent
compareTo, getActions, getAttributes, getAugmentableFlag, getAugmentationKey, getClassifier, getComponents, getConditionals, getDescription, getEndpoints, getId, getLabel, getOrder, getScope, getType, isAugmentable, isTranslatable, setActions, setAttributes, setAugmentable, setAugmentationKey, setClassifier, setComponents, setConditionals, setDescription, setEndpoints, setId, setLabel, setOrder, setScope, setTranslatable, setTypeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.broadleafcommerce.metadata.dsl.core.Component
addAction, addAction, addComponent, addEndpoint, addEndpoint, addSimpleComponent, apply, attribute, augmentable, augmentationKey, classifier, clearConditionals, clearEndpoints, conditional, conditionals, description, description, findAction, findAction, findActions, findAttribute, findAttribute, findComponent, findComponent, findComponents, findEndpoint, findEndpoint, findEndpoint, findEndpoints, get, get, getAction, getAction, getActions, getActionsList, getAttribute, getAttribute, getAttributes, getAugmentableFlag, getAugmentationKey, getClassifier, getComponent, getComponent, getComponents, getComponentsList, getConditionals, getDescription, getEndpoint, getEndpoint, getEndpoints, getEndpointsList, getId, getLabel, getOrder, getScope, getType, hasAction, hasAttribute, hasComponent, hasEndpoint, id, isAugmentable, isTranslatable, label, label, notTranslatable, order, removeAction, removeAttribute, removeComponent, removeEndpoint, scope, self, setActions, setAttributes, setAugmentable, setAugmentationKey, setClassifier, setComponents, setConditionals, setDescription, setEndpoints, setId, setLabel, setOrder, setScope, setTranslatable, setType, translatable, translatable, typeMethods inherited from interface com.broadleafcommerce.metadata.dsl.core.extension.Form
addExternal, addExternal, addField, addField, addField, addFields, addFormComponents, addGroup, addGroup, addMessage, addMessage, external, field, findExternal, findField, findGroup, findMessage, getExternal, getField, getGroup, getMessage, group, message, removeExternal, removeField, removeGroup, removeMessage
-
Constructor Details
-
SuccessResponse
public SuccessResponse() -
SuccessResponse
-
-
Method Details
-
copy
- Specified by:
copyin interfaceCopyable<SuccessResponse>- Returns:
- a deep copy of this instance
-
displayMode
Fluently sets how the success response should be presented to the user.- Parameters:
displayMode- the presentation mode- Returns:
- this component
-
title
Fluently sets the localized title (maps tolabelof the Component) to display in the success view.- Parameters:
title- the message key or plaintext title- Returns:
- this component
-
title
Fluently sets the localized title (maps tolabelof the Component) to display in the success view.- Parameters:
title- the internationalized message title- Returns:
- this component
-
message
Fluently sets the localized message or instructions (maps todescriptionof the Component) to display in the success view.- Parameters:
message- the message key or plaintext message- Returns:
- this component
-
message
Fluently sets the localized message or instructions (maps todescriptionof the Component) to display in the success view.- Parameters:
message- the internationalized message instructions- Returns:
- this component
-
messageStyle
Fluently sets the styling to apply to the message.- Parameters:
messageStyle- the message style- Returns:
- this component
-
onCloseRedirect
Sets the action to perform after the user closes the success view.- Parameters:
onCloseRedirect- the action to perform- Returns:
- this component
-
field
Fluently adds a field definition for extracting and rendering a property from the API response, mapping it to a specific response property path.Automatically sets the field's ID and Name to match the specified response property path.
- Parameters:
responseProperty- the property name in the API response JSONfield- the field metadata to add- Returns:
- this component
- Since:
- Metadata Service 2.0.9, Release Train 2.3.1
-
requireExplicitClose
Fluently sets whether the user must explicitly click a close button to dismiss the view.- Parameters:
requireExplicitClose- true to require explicit closure, false otherwise- Returns:
- this component
-
getDisplayMode
How the success response should be presented to the user. Defaults toSuccessResponse.DisplayMode.MODAL. -
getOnCloseRedirect
The action to perform after the user closes the success response view. Defaults toSuccessResponse.OnCloseRedirect.UPDATE. -
getMessageStyle
The styling to apply to the message. -
isRequireExplicitClose
public boolean isRequireExplicitClose()If true, forces the user to explicitly click a close button to dismiss the view, preventing accidental dismissal (e.g., via clicking the backdrop or hitting the Escape key). Defaults to false. -
setDisplayMode
How the success response should be presented to the user. Defaults toSuccessResponse.DisplayMode.MODAL. -
setOnCloseRedirect
The action to perform after the user closes the success response view. Defaults toSuccessResponse.OnCloseRedirect.UPDATE. -
setMessageStyle
The styling to apply to the message. -
setRequireExplicitClose
public void setRequireExplicitClose(boolean requireExplicitClose) If true, forces the user to explicitly click a close button to dismiss the view, preventing accidental dismissal (e.g., via clicking the backdrop or hitting the Escape key). Defaults to false. -
toString
- Overrides:
toStringin classAbstractComponent<SuccessResponse>
-
equals
- Overrides:
equalsin classAbstractComponent<SuccessResponse>
-
canEqual
- Overrides:
canEqualin classAbstractComponent<SuccessResponse>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractComponent<SuccessResponse>
-