Class Perspective

java.lang.Object
org.gorpipe.querydialogs.factory.Perspective

public class Perspective extends Object
Represents a particular perspective onto data returned from a dialog query.
  • Field Details

    • GLOBAL_GROUP

      public static final String GLOBAL_GROUP
      The group name assigned to perspectives that don't define their own group names.
      See Also:
  • Constructor Details

    • Perspective

      public Perspective(String namePrefix, String name, String groupName, Boolean isDefault, String filterTemplate, String viewTemplate, List<Object> viewTemplateColumns, List<Object> initialColumns)
    • Perspective

      public Perspective(Perspective persp)
      Constructor that copies the input perspective.
      Parameters:
      persp - the perspective to copy
  • Method Details

    • initializeTempleConfig

      public static void initializeTempleConfig(org.gorpipe.gor.model.FileReader fileResolver)
    • getName

      public String getName()
      Returns:
      the name of this perspective
    • getGroupName

      public String getGroupName()
      Returns:
      the group name if one has been defined, GLOBAL_GROUP otherwise.
    • isDefault

      public boolean isDefault()
      Note: no enforcement of only one default perspective
      Returns:
      true if this is the default perspective
    • getViewType

      public Perspective.VIEW_TYPE getViewType()
      Returns:
      The type of view that should be selected by default when this perspective is activated
    • getViewTemplate

      public String getViewTemplate()
      Returns:
      The template used to describe the perspective's HTML (record) view. Null if the template defines table view.
    • setArgumentMap

      public void setArgumentMap(Map<String,? extends Object> argumentMap)
      Set the perspective argument map.
      Parameters:
      argumentMap - the argument map to set
    • getFilterString

      public String getFilterString()
      Returns:
      a String representing a filter that should be applied to the data for this perspective
    • getViewString

      public String getViewString(Map<String,? extends Object> data)
      Processes this perspectives view template with the given data. Adds access to the the originating dialog's arguments via a mapping to "dialog_args".
      Parameters:
      data - the data to interpolate, containing column to value mappings
      Returns:
      a String representing this perspective's view on the given data or null if no view specified
    • getViewTemplateColumns

      public Set<Object> getViewTemplateColumns()
      Returns:
      the Set of data columns used by this perspectives view, null if no requirements. Columns can be either names or indices
    • getInitialColumns

      public Set<Object> getInitialColumns()
      Returns:
      the Set of columns pertinent to this perspective, or null if none specified. Columns can be either names or indices
    • toString

      public String toString()
      Overrides:
      toString in class Object