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:
  • Constructor Details

    • SuccessResponse

      public SuccessResponse()
    • SuccessResponse

      public SuccessResponse(SuccessResponse other)
  • Method Details

    • copy

      public SuccessResponse copy()
      Specified by:
      copy in interface Copyable<SuccessResponse>
      Returns:
      a deep copy of this instance
    • displayMode

      public SuccessResponse displayMode(String displayMode)
      Fluently sets how the success response should be presented to the user.
      Parameters:
      displayMode - the presentation mode
      Returns:
      this component
    • title

      public SuccessResponse title(String title)
      Fluently sets the localized title (maps to label of 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 to label of the Component) to display in the success view.
      Parameters:
      title - the internationalized message title
      Returns:
      this component
    • message

      public SuccessResponse message(String message)
      Fluently sets the localized message or instructions (maps to description of the Component) to display in the success view.
      Parameters:
      message - the message key or plaintext message
      Returns:
      this component
    • message

      public SuccessResponse message(InternationalizedMessage message)
      Fluently sets the localized message or instructions (maps to description of the Component) to display in the success view.
      Parameters:
      message - the internationalized message instructions
      Returns:
      this component
    • messageStyle

      public SuccessResponse messageStyle(String messageStyle)
      Fluently sets the styling to apply to the message.
      Parameters:
      messageStyle - the message style
      Returns:
      this component
    • onCloseRedirect

      public SuccessResponse onCloseRedirect(String onCloseRedirect)
      Sets the action to perform after the user closes the success view.
      Parameters:
      onCloseRedirect - the action to perform
      Returns:
      this component
    • field

      public SuccessResponse field(String responseProperty, Field<?> 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 JSON
      field - the field metadata to add
      Returns:
      this component
      Since:
      Metadata Service 2.0.9, Release Train 2.3.1
    • requireExplicitClose

      public SuccessResponse requireExplicitClose(boolean 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

      public String getDisplayMode()
      How the success response should be presented to the user. Defaults to SuccessResponse.DisplayMode.MODAL.
    • getOnCloseRedirect

      public String getOnCloseRedirect()
      The action to perform after the user closes the success response view. Defaults to SuccessResponse.OnCloseRedirect.UPDATE.
    • getMessageStyle

      public String 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

      public void setDisplayMode(String displayMode)
      How the success response should be presented to the user. Defaults to SuccessResponse.DisplayMode.MODAL.
    • setOnCloseRedirect

      public void setOnCloseRedirect(String onCloseRedirect)
      The action to perform after the user closes the success response view. Defaults to SuccessResponse.OnCloseRedirect.UPDATE.
    • setMessageStyle

      public void setMessageStyle(String messageStyle)
      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

      public String toString()
      Overrides:
      toString in class AbstractComponent<SuccessResponse>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AbstractComponent<SuccessResponse>
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class AbstractComponent<SuccessResponse>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractComponent<SuccessResponse>