Class Perspective

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

public class Perspective
extends java.lang.Object
Represents a particular perspective onto data returned from a dialog query.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  Perspective.VIEW_TYPE
    Defines the type of view that should be selected by default when the perspective is activated.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String GLOBAL_GROUP
    The group name assigned to perspectives that don't define their own group names.
  • Constructor Summary

    Constructors 
    Constructor Description
    Perspective​(java.lang.String namePrefix, java.lang.String name, java.lang.String groupName, java.lang.Boolean isDefault, java.lang.String filterTemplate, java.lang.String viewTemplate, java.util.List<java.lang.Object> viewTemplateColumns, java.util.List<java.lang.Object> initialColumns)  
    Perspective​(Perspective persp)
    Constructor that copies the input perspective.
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getFilterString()  
    java.lang.String getGroupName()  
    java.util.Set<java.lang.Object> getInitialColumns()  
    java.lang.String getName()  
    java.lang.String getViewString​(java.util.Map<java.lang.String,​? extends java.lang.Object> data)
    Processes this perspectives view template with the given data.
    java.lang.String getViewTemplate()  
    java.util.Set<java.lang.Object> getViewTemplateColumns()  
    Perspective.VIEW_TYPE getViewType()  
    static void initializeTempleConfig​(org.gorpipe.gor.model.FileReader fileResolver)  
    boolean isDefault()
    Note: no enforcement of only one default perspective
    void setArgumentMap​(java.util.Map<java.lang.String,​? extends java.lang.Object> argumentMap)
    Set the perspective argument map.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • GLOBAL_GROUP

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

    • Perspective

      public Perspective​(java.lang.String namePrefix, java.lang.String name, java.lang.String groupName, java.lang.Boolean isDefault, java.lang.String filterTemplate, java.lang.String viewTemplate, java.util.List<java.lang.Object> viewTemplateColumns, java.util.List<java.lang.Object> initialColumns)
      Parameters:
      namePrefix -
      name -
      groupName -
      isDefault -
      filterTemplate -
      viewTemplate -
      viewTemplateColumns -
      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 java.lang.String getName()
      Returns:
      the name of this perspective
    • getGroupName

      public java.lang.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 java.lang.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​(java.util.Map<java.lang.String,​? extends java.lang.Object> argumentMap)
      Set the perspective argument map.
      Parameters:
      argumentMap - the argument map to set
    • getFilterString

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

      public java.lang.String getViewString​(java.util.Map<java.lang.String,​? extends java.lang.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 java.util.Set<java.lang.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 java.util.Set<java.lang.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 java.lang.String toString()
      Overrides:
      toString in class java.lang.Object