Search Results for

    Show / Hide Table of Contents

    Component: Global settings

    Introduction

    Most solutions need to manage global variables that can be used as parameters in server rules, workflows, etc.
    These parameters are deployment specific and should be managed by end users.

    Features

    • List of settings, the list settings must have the following essential functions:
      • Add
      • Edit
      • Delete
      • Advanced edit
    • The component should offer some rules as functions to retrieve a setting by name
    • The value will be always encrypted in the data store

    Manage settings

    The component provides a page to manage all global settings that are used in the application.
    In this page, you can add/edit/delete the setting

    clip_image001

    The following information can be provided when creating/editing setting:

    • Name: The name of the setting
      • This field is required and unique
    • Value: The value of the setting
      • This field is optional
    • Description: This field is used to describe the other information of the setting
      • This field is optional
    • Active: This field is the status of the setting
      • The default value is Active

    clip_image001

    To delete a setting, click on the Delete button.
    Then, a confirmation dialog will be displayed.
    If you select the Confirm button, the setting will be deleted immediately.
    If you select the Cancel button, the deletion will be cancelled.

    clip_image001

    Advance edit used to add/edit/delete multiple settings at the same time.
    You can add new json object to create a new one, edit value to update the existing one.
    Delete a object or delete a whole json array to remove all settings.

    clip_image001

    Using settings

    The component provides a set of server rules to retrieve an application setting value by its own name.
    All rules required an input object that contains name of the setting.

    • CwGs Get By Name
      • Output: a string value
    var parameters = new Dictionary<string, object>();
    parameters.Add("Name", "BM CVR Number");
    var ruleApi = ctx.Use<IRuleApi>(); 
    var result = ruleApi.Eval<string>("CwGs Get By Name", parameters);
    
    • CwGs Get Integer By Name
      • Output: an int value
    var parameters = new Dictionary<string, object>();
    parameters.Add("Name", "Example setting");
    var ruleApi = ctx.Use<IRuleApi>(); 
    var result = ruleApi.Eval<int>("CwGs Get Integer By Name", parameters);
    
    • CwGs Get DateTime By Name
      • Output: a DateTime value
    var parameters = new Dictionary<string, object>();
    parameters.Add("Name", "Example setting");
    var ruleApi = ctx.Use<IRuleApi>(); 
    var result = ruleApi.Eval<DateTime>("CwGs Get DateTime By Name", parameters);
    
    • CwGs Get Decimal Numer By Name
      • Output: a decimal value
    var parameters = new Dictionary<string, object>();
    parameters.Add("Name", "Example setting");
    var ruleApi = ctx.Use<IRuleApi>(); 
    var result = ruleApi.Eval<decimal>("CwGs Get Decimal By Name", parameters);
    
    • CwGs Get Boolean By Name
      • Output: a bool value
    var parameters = new Dictionary<string, object>();
    parameters.Add("Name", "Example setting");
    var ruleApi = ctx.Use<IRuleApi>(); 
    var result = ruleApi.Eval("CwGs Get Boolean By Name", parameters);
    
    • CwGs Get Long By Name
      • Output: a long value
    var parameters = new Dictionary<string, object>();
    parameters.Add("Name", "Example setting");
    var ruleApi = ctx.Use<IRuleApi>(); 
    var result = ruleApi.Eval<long>("CwGs Get Long By Name", parameters);
    

    Installation

    Requirements

    • Casewhere 2.6.10 or later

    Configuration

    1. Import the product
    2. Link the page to your worker sites and configure access control

    Dependencies

    • None

    Releases

    1.0.0

    Changelog

    • List of settings
      • Add
      • Edit
      • Delete
      • Advance edit
    • Server rules to retrieve setting value by name

    Road map

    • Client rule to get the application setting from the frontend
    • Import/export as a standard component
    • Show/hide setting values
    • Apply caching to avoid making too many requests to the database on retrieving application settings
    In This Article
    Back to top Generated by DocFX