Skip to content

Kitto.Web.Routing.Activation

Activation engine for attribute-based routing. Matches incoming URLs against registered resource methods, fills parameters via RTTI, and invokes the handler. Created per-request.

TKXActivation class

Per-request activation context. Holds the matched resource/method, extracted path parameters, and method argument values. Implements IKXActivationContext for injection providers.

pascal
constructor Create(const AURL: TKWebURL;

Creates a per-request activation for the given URL, app base path and HTTP method.

pascal
destructor Destroy;

Frees the captured path parameters.

pascal
property PathParams: TDictionary<string, string> read FPathParams;

Extracted path parameter values (e.g., 'ViewName' -> 'Parties').

pascal
function GetPathParam(const AName: string): string;

IKXActivationContext implementation.

pascal
function TryMatch: Boolean;

Tries to match the URL against all registered resources. Returns True and populates MatchedResource/MatchedMethod if found.

pascal
procedure Invoke;

Invokes the matched handler method. Call only after TryMatch returns True. Creates the resource instance, fills parameters, invokes, and frees.

pascal
function MatchedIsAnonymous: Boolean;

True if the matched handler method is decorated with [TKXAnonymous] (i.e. reachable without authentication). Call after TryMatch.

pascal
function MatchedIsNavigable: Boolean;

True if the matched handler method is decorated with [TKXNavigable] (i.e. may be reached by a top-level browser navigation, e.g. a blob download opened in a new tab). Call after TryMatch.

pascal
function MatchedIsNotPublic: Boolean;

True if the matched handler method is decorated with [TKXNotPublic] (a public view must never exempt it from authentication). Call after TryMatch.

Released under Apache License, Version 2.0.