alfresco-ng2-components/docs/extensions/extension.service.md
Andy Stark 478b299960 [ADF- 3846] Started Extensions library docs (#4095)
* [ADF-3846] Added some doc comments and skeleton doc files

* [ADF-3846] Added basic docs for Extensions library

* [ADF-3846] Fixes to index pages

* [ADF-3846] Did tslint check and fixed error with doc comment
2018-12-21 17:46:03 +00:00

4.3 KiB

Title, Added, Status, Last reviewed
Title Added Status Last reviewed
Extension Service v3.0.0 Experimental 2018-12-17

Extension Service

Manages and runs basic extension functionality.

Class members

Methods

  • evaluateRule(ruleId: string, context: RuleContext): boolean
    Evaluates a rule.
    • ruleId: string - ID of the rule to evaluate
    • context: RuleContext - Parameter object for the evaluator with details of app state
    • Returns boolean - True if the rule passed, false otherwise
  • getActionById(id: string): ActionRef
    Retrieves an action using its ID value.
    • id: string - The ID value to look for
    • Returns ActionRef - Action or null if not found
  • getAuthGuards(ids: string[]): Array<Type<__type>>
    Retrieves one or more auth guards using an array of ID values.
    • ids: string[] - Array of ID value to look for
    • Returns Array<Type<__type>> - Array of auth guards or empty array if none were found
  • getComponentById(id: string): Type<>
    Retrieves a registered extension component using its ID value.
    • id: string - The ID value to look for
    • Returns Type<> - The component or null if not found
  • getEvaluator(key: string): RuleEvaluator
    Retrieves a RuleEvaluator function using its key name.
    • key: string - Key name to look for
    • Returns RuleEvaluator - RuleEvaluator or null if not found
  • getRouteById(id: string): RouteRef
    Retrieves a route using its ID value.
    • id: string - The ID value to look for
    • Returns RouteRef - The route or null if not found
  • getRuleById(id: string): RuleRef
    Retrieves a rule using its ID value.
    • id: string - The ID value to look for
    • Returns RuleRef - The rule or null if not found
  • load(): Promise<ExtensionConfig>
    Loads and registers an extension config file and plugins (specified by path properties).
  • runExpression(value: string, context?: any): any
    Runs a lightweight expression stored in a string.
    • value: string - String containing the expression or literal value
    • context: any - (Optional) Parameter object for the expression with details of app state
    • Returns any - Result of evaluated expression, if found, or the literal value otherwise
  • setAuthGuards(values: Function)
    Adds one or more new auth guards to the existing set.
    • values: Function - The new auth guards to add
  • setComponents(values: Function)
    Adds one or more new components to the existing set.
    • values: Function - The new components to add
  • setEvaluators(values: Function)
    Adds one or more new rule evaluators to the existing set.
    • values: Function - The new evaluators to add
  • setup(config: ExtensionConfig)
    Registers extensions from a config object.

Details

Use the methods of this service to add extensibility features to your app. You can find further details in the App extensions page.