Class PlaceholderDataBean

  • All Implemented Interfaces:
    Serializable

    @RequestScoped
    @Named
    public class PlaceholderDataBean
    extends Object
    implements Serializable
    Caches the list of available placeholders for the duration of the active request. The <p:datatable/> calls the getter for the list once for each row. When the user select a project with hundreds or thousands of form fields, this would result in many requests to the database and takes up to several tens of seconds.
    Author:
    XIMA MEDIA GmbH
    See Also:
    Serialized Form
    • Constructor Detail

      • PlaceholderDataBean

        public PlaceholderDataBean()
    • Method Detail

      • getForCurrentContext

        public List<PlaceHolder> getForCurrentContext()
        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
        Returns:
        All placeholders applicable for the current context
      • getProjects

        public Collection<Projekt> getProjects()
        Returns:
        A list of all available projects. Used to present the user with a selection of available projects for which to show the available form placeholders.
      • setSelectedProject

        public void setSelectedProject​(Projekt selectedProject)
        Parameters:
        selectedProject - The project for which the user wants to display the available form placeholders.
      • getSelectedProject

        public Projekt getSelectedProject()
        Returns:
        The project for which the user wants to display the available form placeholders.