Class FormThemeDeletionModel

  • All Implemented Interfaces:
    Serializable

    public final class FormThemeDeletionModel
    extends Object
    implements Serializable
    Model with a factory method for deleting client form themes. Used by the UI for client form themes. When a user tries to delete a set of form themes, the system checks whether the themes are still in use and informs the user if they are.
    Since:
    8.3.0
    See Also:
    Serialized Form
    • Method Detail

      • getDeletable

        public FormThemeDeletionModel.ThemeGroup getDeletable()
        Gets the themes that are not in use anymore and can be deleted.
        Returns:
        The deletable themes.
      • getDeletableWithWarnings

        public FormThemeDeletionModel.ThemeGroup getDeletableWithWarnings()
        Gets the themes that are still in use, but their deletion would not cause any issues. Such themes can be deleted if the user confirms their deletion.
        Returns:
        The deletable themes with warnings that need to be shown to the user.
      • getNonDeletable

        public FormThemeDeletionModel.ThemeGroup getNonDeletable()
        Gets the themes that are still in use and cannot be deleted.
        Returns:
        The non-deletable themes.
      • forThemes

        public static FormThemeDeletionModel forThemes​(IEntityContext ec,
                                                       Mandant client,
                                                       Locale locale,
                                                       List<ClientFormTheme> themesToDelete)
        Creates the model for the given themes to be deleted. Checks which themes are still in use and adds the appropriate messages to the model.
        Parameters:
        ec - The entity context to use for accessing the database.
        client - The client who owns the themes to be deleted.
        locale - The locale to use for localizing messages.
        themesToDelete - The themes to be deleted.
        Returns:
        The model for the themes to be deleted.