Package org.gorpipe.querydialogs.factory
Class Perspective
java.lang.Object
org.gorpipe.querydialogs.factory.Perspective
Represents a particular perspective onto data returned from a dialog query.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the type of view that should be selected by default when the perspective is activated. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe group name assigned to perspectives that don't define their own group names. -
Constructor Summary
ConstructorsConstructorDescriptionPerspective(String namePrefix, String name, String groupName, Boolean isDefault, String filterTemplate, String viewTemplate, List<Object> viewTemplateColumns, List<Object> initialColumns) Perspective(Perspective persp) Constructor that copies the input perspective. -
Method Summary
Modifier and TypeMethodDescriptiongetName()getViewString(Map<String, ? extends Object> data) Processes this perspectives view template with the given data.static voidinitializeTempleConfig(org.gorpipe.gor.model.FileReader fileResolver) booleanNote: no enforcement of only one default perspectivevoidsetArgumentMap(Map<String, ? extends Object> argumentMap) Set the perspective argument map.toString()
-
Field Details
-
GLOBAL_GROUP
The group name assigned to perspectives that don't define their own group names.- See Also:
-
-
Constructor Details
-
Perspective
-
Perspective
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
- Returns:
- the name of this perspective
-
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
- Returns:
- The type of view that should be selected by default when this perspective is activated
-
getViewTemplate
- Returns:
- The template used to describe the perspective's HTML (record) view. Null if the template defines table view.
-
setArgumentMap
Set the perspective argument map.- Parameters:
argumentMap- the argument map to set
-
getFilterString
- Returns:
- a String representing a filter that should be applied to the data for this perspective
-
getViewString
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
- Returns:
- the Set of data columns used by this perspectives view, null if no requirements. Columns can be either names or indices
-
getInitialColumns
- Returns:
- the Set of columns pertinent to this perspective, or null if none specified. Columns can be either names or indices
-
toString
-