java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<ViewLayout>
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, com.vaadin.flow.router.AfterNavigationObserver, com.vaadin.flow.router.BeforeEnterObserver, com.vaadin.flow.router.BeforeLeaveObserver, com.vaadin.flow.router.HasDynamicTitle, com.vaadin.flow.router.internal.AfterNavigationHandler, com.vaadin.flow.router.internal.BeforeEnterHandler, com.vaadin.flow.router.internal.BeforeLeaveHandler, FacetOwner, FragmentOwner, ChangeTracker, DetailView<NotificationModel>, HasEditedEntity<NotificationModel>, ReadOnlyAwareView, ReadOnlyTracker, SupportEntityLock<NotificationModel>, Serializable

@ViewController("bpm_NotificationModel.edit") @ViewDescriptor("notification-edit.xml") @DialogMode(width="40em", resizable=true) public class NotificationEdit extends StandardDetailView<NotificationModel>
Editor dialog for a single process notification declared on a user task or a service task. The available events/recipient types depend on the owning element's kind, set once by the caller via setUserTaskScope(boolean) right after the dialog is built.
See Also:
  • Field Details

  • Constructor Details

    • NotificationEdit

      public NotificationEdit()
  • Method Details

    • setUserTaskScope

      public void setUserTaskScope(boolean userTaskScope)
      Switches the editor between user-task scope (event field shown and required, the full set of recipient types available) and service-task scope (no event, only initiator/expression recipients). Must be called before the dialog is opened; the effect is applied when the view is shown.
      Parameters:
      userTaskScope - true when editing a notification declared on a user task
    • onInit

      @Subscribe public void onInit(View.InitEvent event)
    • onInitEntity

    • onBeforeShow

      @Subscribe public void onBeforeShow(View.BeforeShowEvent event)
    • initVariablesHelp

      protected void initVariablesHelp()
      Attaches a question-mark help button that opens a dialog describing the variables available for substitution.
    • createVariablesHelpButton

      protected JmixButton createVariablesHelpButton()
    • showVariablesHelp

      protected void showVariablesHelp()
    • initChannelsGroup

      protected void initChannelsGroup()
      Offers only the channels that are actually available: in-app is always present, email only when the email add-on (which provides the email notification channel) is on the classpath. When a single channel is available there is nothing to choose; that is recorded in singleChannel and applied when the value is set (see initChannelsGroupValue()).
    • initTypeField

      protected void initTypeField()
      Populates the type lookup from the registered notification types and renders each with its icon. Hidden entirely when the Notifications add-on (hence the type provider) is absent.
    • initMessageTemplate

      protected void initMessageTemplate()
      Embeds the message-template picker only when the Message Templates add-on is present; otherwise the box stays empty and hidden. The fragment is created programmatically (not declared in XML) so that this view never references the add-on's types when the add-on is absent.
    • onTemplateCodeChanged

      protected void onTemplateCodeChanged(@Nullable String templateCode)
    • initChannelsGroupValue

      protected void initChannelsGroupValue()
      Populates the channels field from the edited notification (comma-separated names), defaulting to in-app when nothing is stored. When a single channel is available it is forced and the field is made read-only. Done here, not in onInit, because the field is unbound and its value must be derived from the already-loaded entity.
    • applyScope

      protected void applyScope()
    • initFieldsVisibility

      protected void initFieldsVisibility()
    • applyBodyFieldsVisibility

      protected void applyBodyFieldsVisibility()
      Shows the body editor matching the selected content type — a rich-text editor for HTML, a plain text area otherwise — and hides both when a message template is chosen (the body then comes from the template).
    • onRecipientTypeFieldComponentValueChange

      @Subscribe("recipientTypeField") public void onRecipientTypeFieldComponentValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixComboBox<NotificationRecipientType>,NotificationRecipientType> event)
    • updateRecipientTypeHint

      protected void updateRecipientTypeHint(@Nullable NotificationRecipientType type)
      Explains, under the recipient-type field, where the recipients come from for the selected type, since most types resolve them from the process/task and offer no input of their own.
      Parameters:
      type - selected recipient type, or null when nothing is selected
    • onChannelsGroupComponentValueChange

      @Subscribe("channelsGroup") public void onChannelsGroupComponentValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixCheckboxGroup<String>,Set<String>> event)
    • onContentTypeFieldComponentValueChange

      @Subscribe("contentTypeField") public void onContentTypeFieldComponentValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixRadioButtonGroup<String>,String> event)
    • confirmBodyReset

      protected void confirmBodyReset()
      Confirms clearing the body when the user switches content type from HTML to plain text, since the formatted content cannot be carried over. On confirmation the body is cleared and the plain editor is shown; otherwise the content type is reverted back to HTML.
    • onTypeFieldCustomValueSet

      @Subscribe("typeField") public void onTypeFieldCustomValueSet(com.vaadin.flow.component.combobox.ComboBoxBase.CustomValueSetEvent<com.vaadin.flow.component.combobox.ComboBox<String>> event)
    • onTypeFieldComponentValueChange

      @Subscribe("typeField") public void onTypeFieldComponentValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.combobox.ComboBox<String>,String> event)
    • renderTypeOption

      protected com.vaadin.flow.component.Component renderTypeOption(String typeName)
    • channelsGroupItemLabelGenerator

      @Install(to="channelsGroup", subject="itemLabelGenerator") protected String channelsGroupItemLabelGenerator(String item)
    • contentTypeFieldItemLabelGenerator

      @Install(to="contentTypeField", subject="itemLabelGenerator") protected String contentTypeFieldItemLabelGenerator(String item)
    • typeFieldItemLabelGenerator

      @Install(to="typeField", subject="itemLabelGenerator") protected String typeFieldItemLabelGenerator(String item)