Shell.Configuration.js
Applies To: Windows Azure Pack
Gets or creates the configuration settings associated with the user that is logged in on the site.
Configuration settings are saved on the server. The server can regularly remove saved settings that are no longer needed.
Widgets
None.
Properties
None.
Methods
Name |
Description |
Returns |
Parameters |
---|---|---|---|
Shell.Configuration.createFullUserSettings |
Creates a full user settings object. Wraps settings with shared attributes. |
Object |
store (String): store (extension name). type (String): setting type: user or subscription. subscriptionId (String): subcription id. settings (Array): Settings to wrap. |
Shell.Configuration.createSingleUserSetting |
Creates a full single user settings object. |
Object |
store (String): store (extension name). type (String): setting type: user or subscription. subscriptionId (String): subcription id. resourceName (String): resource name. name (String): setting name. value (String): setting value. |
Shell.Configuration.createUserSetting |
Creates a user setting object. |
Object |
resourceName (String): name (String): value (String): |
Shell.Configuration.deleteLoadedUserSettings |
Deletes user settings that were previously preloaded. |
jQuery.Deferred |
args (Object): Arguments describing the settings to delete. |
Shell.Configuration.deleteUserSettings |
Deletes user settings. |
jQuery.Deferred |
args (Object): Arguments describing the settings to delete. |
Shell.Configuration.deleteUserSettingsByPrefix |
Deletes user settings whose paths match one of a set of supplied path prefixes. |
jQuery.Deferred |
args (Object): Arguments describing the settings to delete. |
Shell.Configuration.getLoadedUserSettings |
Gets setting values for specific path/name pairs from a preloaded cache. |
jQuery.Deferred |
args (Object): Arguments describing the setting-path/name pairs. |
Shell.Configuration.getUserSettings |
Gets setting values for specific path/name pairs. |
jQuery.Deferred |
args (Object): Arguments describing the setting-path/name pairs. useCache (Boolean): Use the cache instead of directly querying the server. readThroughCache (Boolean): Fetch from the settings service if settings are not present in cache. |
Shell.Configuration.initialize |
Initializes the configuration cache. |
jQuery.Deferred |
None. |
Shell.Configuration.updateLoadedUserSettings |
Updates user setting values that were previously preloaded. |
jQuery.Deferred |
args (Object): Arguments describing the settings to update. delaySyncWithService (Boolean): Delay saving to user settings service for 5 seconds after most recent update to reduce network chatter. |
Shell.Configuration.updateUserSetting |
Updates a single user setting. |
jQuery.Deferred |
setting (Object): Settings to update. A single one, [0] is updated. value (String): Keys to delete. |
Shell.Configuration.updateUserSettings |
Updates the user settings. |
jQuery.Deferred |
args (Object): Arguments describing the settings to update. updateCache (Boolean): Updates the cache in addition to updating settings in the settings service. |
Examples
Get user settings:
Shell.Configuration.getUserSettings("thesettingINeedToAccess").then(
function(result) {
if (result) {
result.Value; // do something useful with the value
} else {
// setting does not exist
}
},
function(error) {
// Failed to contact server
}
);
Create or change the value of a user setting:
Shell.Configuration.updateUserSettings({ Name: "the-setting-to-update", Value: "theNewValue" }).then(
function(result) {
// result is the setting which was changed
},
function(error) {
// Failed to contact server
}
);
Delete a user setting:
Shell.Configuration.deleteUserSettings("setting1-to-delete").then(
function(result) {
// completed
},
function(error) {
// Failed to contact server
}
);