Class PlaceholderBean

  • All Implemented Interfaces:
    Serializable

    @Named
    @ViewScoped
    public class PlaceholderBean
    extends Object
    implements Serializable
    This bean provides a list of available placeholders for an input field. Different placeholders may be available, depending on the current context. For example, when the user is editing a project, placeholders for form elements of that project are available.

    Each placeholder belongs to a IPlaceholderType. In the dialog, placeholders are grouped according to this type.

    To control which placeholders are available, there exists:

    1. a IPlaceholderLibrary that contains the registered placeholders. It contains several groups and a set of placeholders for that group. A group is just any Object, eg. SYSTEM placeholders, FORM placeholders or custom placeholders. This lets you change the placeholders for a certain group without affecting other groups.
    2. a set of groups which are currently active. Only the placeholders for those groups are shown in the dialog. This makes it possible to deactivate a group of placeholders and activate it again later without having to recreate the placeholders.

    There are also a few events available that can be triggered from another bean to update the placeholders:

    Author:
    XIMA MEDIA GmbH
    See Also:
    Serialized Form
    • Constructor Detail

      • PlaceholderBean

        public PlaceholderBean()
    • Method Detail

      • comparePlaceholderType

        public int comparePlaceholderType​(IPlaceholderType lhs,
                                          IPlaceholderType rhs)
        Compares two given placeholder types.
        Parameters:
        lhs - First placeholder type
        rhs - Second placeholder type
        Returns:
        -1 if lhs < rhs, 1 if lhs > rhs, 0 if lhs == rhs.
      • createPlaceholdersForCurrentContext

        public List<PlaceHolder> createPlaceholdersForCurrentContext()
        All available placeholders, depending on the current context (i.e. whether the user is editing a project etc.). This includes, but is not limited to:
        • System placeholders
        • Template placeholders (HTML, TEXT, URL, MAIL)
        • Form element placeholders for a certain project
        • Placeholders from the currently active designer tab (e.g. workflow action results)
        Returns:
        All placeholders applicable for the current context
      • getActions

        public PlaceholderBean.PlaceholderActions getActions()
        Methods that can be used from the outside to modify the available placeholders. All other methods of this bean should not be called directly and are for internal use by the placeholder view only.
        Returns:
        A set of methods for modifying the available placeholders, such as changing which placeholders groups are shown or adding new placeholder groups.
      • getLibrary

        public PlaceholderLibrary getLibrary()
        Returns:
        The library with the registered placeholders.
      • getModel

        public PlaceholderContextModel getModel()
        Returns:
        The placeholder model with the placeholders that are shown in the UI.
      • getProjects

        public Collection<Projekt> getProjects()
        Returns:
        A list of projects that the user may select to change which form placeholders are displayed.
      • load

        public void load()
        No-op, but calling this ensures that PostConstruct gets called when this bean is created via CDI.
      • updatePlaceholders

        public void updatePlaceholders​(boolean withLoadingDialog)
        Action listener to update the available placeholders.
        Parameters:
        withLoadingDialog - true to show a loading dialog, false to perform the action in the background.
      • actions

        public static PlaceholderBean.PlaceholderActions actions()
        Methods that can be used from the outside to modify the available placeholders. All other methods of this bean should not be called directly and are for internal use by the placeholder view only.
        Returns:
        A set of methods for modifying the available placeholders, such as changing which placeholders groups are shown or adding new placeholder groups.