Member Junction
    Preparing search index...

    First-level subclass of EntityDocumentTemplateParserBase used to parse entity document templates with variables, dotted context paths (__Parent), and functions such as Relationship().

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _provider?: IMetadataProvider

    Optional provider override; falls back to Metadata.Provider when not set.

    __cache: Record<string, string> = {}

    Accessors

    Methods

    • Parses an entity document template and replaces values within ${} placeholders with actual values from the entity record. If template uses Nunjucks {{ }} syntax, it is pre-rendered with the MJ TemplateEngine first.

      Parameters

      • Template: string

        the document template to parse

      • EntityID: string

        the ID of the entity

      • EntityRecord: Record<string, unknown>

        the values for the entity record (may contain __Parent context)

      • ContextUser: UserInfo

        the current user

      Returns Promise<string>

      the evaluated value of the template incorporating fields, nested contexts, and function call(s)

    • Resolves related records for an entity and recursively renders a child Entity Document over each.

      Parameters

      • entityID: string

        ID of the parent entity

      • entityRecord: Record<string, unknown>

        Data of the parent entity record

      • ContextUser: UserInfo

        Current user info

      • relationshipName: string

        Name of the related entity / relationship

      • maxRows: number

        Maximum number of related rows to load

      • entityDocumentName: string

        Name of the child Entity Document to render over each related row

      Returns Promise<string>

      Concatenated rendered output for all related rows, or raw JSON data if no document specified