Framework: ConfigurationContext - akumina/AkuminaTraining GitHub Wiki
Overview
The ConfigurationContext is an object accessible throughout the Akumina Foundation Site that stores information about Akumina Foundation Site. As of 4.0.0.0, the Configuration Context object draws its data from an AppManager endpoint.
Initializing the Configuration Cache
The settings that are placed in the Configuration Cache are initialized when the Digital Workplace Core Site is run from the SiteCreator. Data stored in 3 places and pushed to the AppManager Endpoint upon the execution of Caching Events
Data Locations
- DigispaceConfigurationIDS_AK List
- digitalworkplace.custom.js
- Azure Table
A note about digitalworkplace.custom.js
The InterchangeURL and InterchangeQueryKey properties are provisioned initially inside of the LoaderConfiguration.Custom object by the SiteCreator. However, additional changes need to be made manually.
Caching Events
The AppManager Endpoint Cache will refresh upon the execution of the following events.
- A Widget's properties are edited on the front end
- A Widget's properties are edited on the back end
- The Cache Widget Instances button is clicked within the Widget Manager
- The SiteCreator Update Configuration Settings action is run
- Refresh Configuration Cache is clicked within the Debug Panel
Viewing your Configuration Context object
To view all properties currently stored within your ConfigurationContext simply type the following javascript line into your console on a site with Digital Workplace Core deployed.
Akumina.Digispace.ConfigurationContext
A JSON Object will be returned with your Configuration Context properties
Retrieving Data
We can retrieve data from a ConfigurationContext property by calling the Akumina.Digispace.ConfigurationContext object followed by the name of the desired property. Use the example below as a model:
//Get the theme property
var property = Akumina.Digispace.ConfigurationContext.Theme;
//Display in console
console.log(property);
Storing Data
We can store data in a UserContext property by calling the Akumina.Digispace.ConfigurationContext object followed by the name of the desired property. Use the example below as a model:
//Assign data to a property
//We can create our own property here
var customProperty = "ConfigurationContext is COOL";
Akumina.Digispace.ConfigurationContext.OurProperty = customProperty;
//Display in console
console.log(Akumina.Digispace.ConfigurationContext.OurProperty);