Kitto.Metadata.Views
The view metadata layer. Defines views (TKView) that pair a controller with data/UI configuration, their catalog (TKViews), the layouts (TKLayout) that arrange fields, tree views (TKTreeView) that form navigation menus, and the registries, view builders and factory that instantiate them from YAML.
TKView class
property Catalog: TKViews read GetCatalog;The views catalog this view belongs to.
property DefaultImageName: string read GetDefaultImageName;The default icon name when ImageName is not set.
property MobileSettings: string read GetMobileSettings;RTTI carrier for the MobileSettings node (e.g. MobileSettings/Android/Manifest for the home view). Read by path at run time.
TKViewList class
A simple list of views.
procedure AddViewNamesToStrings(const AStrings: TStrings);Adds the name of each view in the list to AStrings.
TKLayoutFieldConfig class
Field-level layout overrides. YAML path: Layout/Field
TKLayoutFieldSetConfig class
FieldSet grouping in a layout. YAML path: Layout/FieldSet
property Row: string read GetRow;RTTI carrier for a Row node: a horizontal group of fields laid out side by side inside this fieldset (each child is a Field). The getter is unused; the row is walked node by node at render time.
TKLayout class
function IsGridLayout: Boolean;True if the layout is a grid layout (its name ends with '_Grid').
function IsFormLayout: Boolean;True if the layout is a form layout (its name ends with '_Form').
TKViews class
A catalog of views.
constructor Create(const AModels: TKModels);Creates the views catalog bound to the given models catalog.
property ViewCount: Integer read GetViewCount;Number of views in the catalog.
property Views[I: Integer]: TKView read GetView;The views, by index (default property).
function ViewByName(const AName: string): TKView;Returns the view with the given name; raises if absent.
function ViewByName(const ANames: TStringDynArray): TKView;Returns the first existing view among the given names; raises if none.
function FindView(const AName: string): TKView;Returns the view with the given name, or nil.
function ViewByNode(const ANode: TEFNode): TKView;Returns the view referenced/built from the given node; raises if absent.
function FindViewByNode(const ANode: TEFNode): TKView;Returns the view referenced/built from the given node, or nil.
procedure GetViewList(const AList: TKViewList);Reads the Views/ directory from disk and fills AList with all views found. AList is cleared first. If the catalog is not yet open it calls Open; if already open it calls Refresh, so each call reflects the current on-disk state.
property Models: TKModels read FModels;The models catalog the views refer to.
property Layouts: TKLayouts read GetLayouts;The layouts catalog associated with these views.
procedure Open;Opens the catalog (loads views from the Views/ directory).
procedure Refresh;Re-reads the catalog from disk.
procedure Close;Closes the catalog and releases loaded views.
TKLayoutList class
A simple list of layouts.
TKLayouts class
A catalog of layouts. Internally used by the catalog of views.
property LayoutCount: Integer read GetLayoutCount;Number of layouts in the catalog.
property Layouts[I: Integer]: TKLayout read GetLayout;The layouts, by index (default property).
function LayoutByName(const AName: string): TKLayout;Returns the layout with the given name; raises if absent.
function FindLayout(const AName: string): TKLayout;Returns the layout with the given name, or nil.
function LayoutByNode(const ANode: TEFNode): TKLayout;Returns the layout referenced by the given node; raises if absent.
function FindLayoutByNode(const ANode: TEFNode): TKLayout;Returns the layout referenced by the given node, or nil.
procedure GetLayoutList(const AList: TKLayoutList);Reads the Layouts/ directory from disk and fills AList with all layouts found. AList is cleared first. If the catalog is not yet open it calls Open; if already open it calls Refresh, so each call reflects the current on-disk state.
TKActionView class
A view that executes an action.
IKTreeViewNodes interface
Interface implemented by objects that hold a list of tree-view nodes.
property TreeViewNodeCount: Integer read GetTreeViewNodeCount;Number of child tree nodes.
property TreeViewNodes[I: Integer]: TKTreeViewNode read GetTreeViewNode;The child tree nodes, by index.
TKTreeViewNode class
property DisplayLabel: string read GetDisplayLabel;Label shown for this node in the tree/menu (overrides the label of the view it points to).
property ImageName: string read GetImageName;Icon shown for this node in the tree/menu (overrides the view''s icon).
property ViewType: string read GetViewType;Type of the optional inline view defined directly under this node (instead of naming an existing view by value).
property MainTable: string read GetMainTable;RTTI carrier for the MainTable of an inline view defined under this node. Kept as an anchor (not a typed sub-node) because Kitto.Metadata.Views must not reference the DataView unit (which uses it); the inline table is walked node by node.
property TreeViewNodeCount: Integer read GetTreeViewNodeCount;Number of child tree nodes.
property TreeViewNodes[I: Integer]: TKTreeViewNode read GetTreeViewNode;The child tree nodes, by index.
function FindView(const AViews: TKViews): TKView;Resolves the view this node points to within AViews, or nil.
function GetACURI(const AView: TKView): string;Returns the access-control URI for the given view (for ACL checks).
TKTreeViewFolder class
property Back: string read GetBack;RTTI carrier for the Back node: a "go back" entry shown inside the folder (its ImageName/DisplayLabel). Read node by node at render time.
function FindView(const AViews: TKViews): TKView;A folder has no own view; returns nil.
TKTreeView class
property TreeViewNodeCount: Integer read GetTreeViewNodeCount;Number of child tree nodes.
property TreeViewNodes[I: Integer]: TKTreeViewNode read GetTreeViewNode;The child tree nodes, by index.
TKViewRegistry class
Singleton registry mapping type ids to view classes.
class function HasInstance: Boolean;True if the singleton instance already exists.
function GetClass(const AId1, AId2: string): TKViewClass;Returns the registered view class for the given id(s).
TKViewBuilder class
Base class for objects that build a view on the fly from configuration (rather than loading it from a YAML file). Referenced through 'Build <BuilderName>' in a view node.
function BuildView(const AViews: TKViews;Builds a view into AViews (optionally persistent/named), returning it. Override in a descendant to auto-generate a view from configuration.
TKViewBuilderRegistry class
Singleton registry mapping ids to view-builder classes.
function GetClass(const AId: string): TKViewBuilderClass;Returns the registered view-builder class for the given id.
TKViewBuilderFactory class
Singleton factory that instantiates view builders by registered id.
function CreateObject(const AId: string): TKViewBuilder;Creates a view-builder instance for the given registered id.
TKLayoutRegistry class
Singleton registry mapping type ids to layout classes.
function GetClass(const AId1, AId2: string): TKLayoutClass;Returns the registered layout class for the given id(s).
