CodBi
    Preparing search index...

    Implements the management functionality.

    Implements

    Index

    Constructors

    • Creates an instance of CodBi also setting the specified "initiator" & "paramSeparator".

      Parameters

      • nestingBraces: {
            closing: string;
            epSeparator: string;
            opening: string;
            paramSeparator: string;
        } = ...

        The CodBi.nestingBraces configuration for this instance.

      • cssProcessing: string = ...

        The CSS to be applied on Elements that're currently being processed by the CodBi.

      Returns CodBi

    Properties

    autoCheckAttributes: boolean = false
    availableEPs: { [k: string]: (params: string[]) => unknown } = {}

    Stores all Element Placeholder that were registered.

    baseURL: string = ...
    checkingAttributes: boolean = false

    Indicates whether the CodBi is currently in the process of checking attributes (checkAttributes).

    configs: string[] = ...

    Stores all active CSS-Classes that're references to CodBi Standard-Configurations.

    configTemplate: ConfigTemplate = undefined
    currentAttributeCheck: Promise<boolean>

    Stores the current checkAttributes - Promise.

    firstTimer: HTMLElement[] = ...
    functionalities: Map<string, (toLoad: any, toProcess: Element) => any> = ...
    nestingBraces: {
        closing: string;
        epSeparator: string;
        opening: string;
        paramSeparator: string;
    } = ...

    Stores the CodBi's control characters.

    resourceBase: string = ...

    Stores the path to the XIMA-Server's resources including the CodBi code fragments.

    settingsErrorReporting: { throw: boolean } = ...

    Stores the settings for error reporting.

    settingsInfoReporting: { log: boolean } = ...

    Stores the settings for information reporting.

    Methods

    • Applies the method toApply on all Elements within the document that correspond to the specified targets. The parameter targets is a TSV (basically multiple CSS-Selectors ) that're separated by a tilde.

      Parameters

      • targets: string

        The TSV specifying the Elements to invoke the method toApply on.

      • toApply: (target: Element) => undefined

        The method to apply on each Element specified by the targets.

      Returns undefined

    • Processes all Elements that're tagged with a certain Attribute (data-cb-func) in order to activate CodBi-Functionalities. The Attribute data-cb-func is a CSV containing all CodBi-Functionalities to activate.

      When having found an Element this methods will look for all attributes named data-cb-.... When activating a CodBi-Functionality for an Element those attributes will be passed as a Key/Value-JSON to the functionality with the data-cb- prefix removed from the keys.

      This method also looks for global variables related to the functionality to be used. Those may be specified in the GUI's "Variables" section and got to be prefixed with the functionality's name (using underscores instead of dots separators however (e.g. time.frame becomes time_frame)) followed by the variable's name without the data-cb- prefix (e.g. Time_Frame_MaxField). For being useful to define values that're common to multiple functionalities but still pertain the possibility to overwrite those values when needed, global variables have the least precedence and will be overwritten by the ones the Element has.

      The attribute data-cb-apply may be used to apply all global variables and all attributes of the Elements to the ones specified by the CSS-Selector-TSV, which is this attribute's value (take care to use data-org-name in CSS-Attribute-Selectors in order for the application to also work in repetitive containers). Global variables and those received from the original Element may be overwritten simply by re-specifying the variable-attribute on the Elements data-cb-apply refers to where suitable.

      The data-cb-Loader attribute, if set to "none" (case insensitive), does deactivate the loader-animation only, not the disabling if HTMLInputElements as long as the tagged Element hasn't been processed.

      CAUTION: The suspension of processing will also result in delaying the disabling for input of all further elements.

      Returns Promise<boolean>

      A Promise < boolean > that resolves a soon as all Elements where initially processed and the application of functionalities as the retrieval of Element Placeholder values has been triggered.

      A CodBiError when the processing of an Element throws one.

    • Transfer all CodBi-Attributes (data-cb) that're existent on the HTMLElement to copy from to the one to copy to.

      Parameters

      • from: HTMLElement

        The HTMLElement to transfer from.

      • to: HTMLElement

      Returns void

    • Extends an given Element Placeholder so that both the former one and the new one are invoked whereas the form one itself may also be an extension already. The value retrieved from the former Element Placeholder will be passed to the new one which may further transform the resulting values. If an Element Placeholder with the given id hasn't been registered yet the new one will be registered using CodBi.registerEP.

      Parameters

      Returns boolean

      TRUE if an extension took place or FALSE if a regular registration was performed.

    • Retrieves the Attributes out of the given Element toExtractFrom that are related to the CodBi (data-cb- prefixed). Those attributes may contain Element Placeholder that are introduced by an DBC.nestingBraces.opening brace. The placeholder and it's optional parameter are separated

      Parameters

      • toExtractFrom: Element

        The Element to extract the CodBi-Attributes from.

      Returns { [key: string]: unknown }

      The {[key: string]: unknown } containing the attribute names and values.

    • Extracts all Element Placeholders used within a CodBi-Attribute's value with nesting supported. Those placeholders are of following format { placeholder e.g. HTML.Text.Mapper > Parameter SSV }.

      Parameters

      • toExtractFrom: string

        The CodBi-Attributes's string to extract the Element Placeholders from.

      Returns string[]

      The listing of Element Placeholders that were found in the string toExtractFrom.

    • Retrieves all parameter that're globally available for the specified "namespace". Those got to be underscore-separated (e.g. Date_Frame_MaxField) when entered in the "Variables" section of the GUI. Transforming dot-separated to underscore-separated an vice versa is handled automatically.

      Parameters

      • namespace: string

        The string-prefix a global parameter has to be tagged with to be retrieved.

      Returns { [key: string]: string }

    • Retrieves the inner string from the outermost braces pair specified out of the given string.

      Parameters

      • toGetFrom: string

        The string where to extract the one surrounded by the specified brackets pair from.

      Returns { keyPlaceholder: string; params: string }

      The requested string or NULL if there're no braces.

      A CodBiError if the count of the opening & closing CodBi.nestingBraces doesn't match.

    • Loads a configuration as a JSON by applying it to the Elements defined in it's targets attribute (a tilde separated list of CSS-Selectors). All other properties define the tagged Element's CodBi-Attributes (e.g. FUNC will become data-cb-FUNC on the Element.

      Prior to applying the new attributes to the Elements the FUNC property of the toLoad will be inspected in order to spot any functionalities that're not yet loaded and missing code fragments be loaded from the Formcycle-Server. The same process will be used on every other property, except of targets to identify element placeholders and load missing code fragments prior to applying any new attribute on any Element.

      Parameters

      • toLoad: { targets: string }

        The CodBi-Configuration to apply onto the targeted Elements.

      Returns Promise<void>

      A Promise < void > indicating when the operation including loading missing code fragments has been completed.

    • Merges a with b overwriting all properties in a that're existent in both. Properties that exist in b will be added to a.

      Parameters

      • a: { [key: string]: unknown }

        The {[key: string]: unknown } to merge.

      • b: { [key: string]: unknown }

        The {[key: string]: unknown } to merge.

      Returns { [key: string]: unknown }

      a merged with b.

    • Registers an Element Placeholder using the specified string as it's id.

      Parameters

      • id: string

        The string the placeholder should get as it's id.

      • generator: (params: string[]) => unknown

        The actual placeholder's ( params : Array < string >) => Array< unknown >.

      Returns boolean

    • Registered a new functionality with the specified {@params id}.

      Parameters

      • id: string

        The string identifying the new functionality in {@CodBi.functionalities}.

      • init: (toLoad: unknown, toProcess: Element) => unknown

        The method to incorporating the new functionality.

      Returns boolean

      TRUE on successful registration, otherwise FALSE.

    • Reports using CodBi.reportError using the specified details.

      Parameters

      • cause: Element

        The currently processed Element the error occurred in.

      • functionality: string

        The functionality the error came up in.

      • parameter: { [key: string]: unknown }

        The parameter that where passed to the "functionality".

      • exception: any

        The Error that occurred.

      • message: string

        An optional string containing further non conform details.

      Returns void

    • Resolves all CodBi.availableEPs in all string-values and Array -values that're defined within the given {@params config} recursively.

      Parameters

      • config: { [key: string]: unknown }

        The JSON-Config to resolve each EP in.

      Returns Promise<{ [key: string]: unknown }>

    • Resolves nested Element Placeholder within Element Placeholder Parameter recursively (CodBi.epSeparator's count of initiators determine the level of possible nesting).

      Parameters

      • params: string[]

        The Element Placeholder Parameter to check for Element Placeholder.

      Returns Promise<string[]>

      The resolved incoming params.