Member Junction
    Preparing search index...

    Class EntityDocumentTemplateParserBaseAbstract

    Abstract base class for entity document template parsing. Use EntityDocumentTemplateParser or a subclass thereof.

    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

    • Evaluates a single placeholder argument: either a function call like Relationship(...) or a field/path reference like Name or __Parent.Title.

      Parameters

      • argument: string
      • entityID: string
      • entityRecord: Record<string, unknown>
      • ContextUser: UserInfo

      Returns Promise<string>

    • 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)