© 2009 OMTP Ltd. All rights reserved. OMTP and OMTP BONDI are registered trademarks of OMTP Ltd.
To configure applications from the Web context
AppConfigManager
AppConfigManagerObject
| Interface | Method |
|---|---|
| AppConfigManager | DOMString get(DOMString key) void set(DOMString key, DOMString value) |
| AppConfigManagerObject |
This module exposes facilities that relate to application settings and preferences, including:
- static settings defined by the author of the web application.
- settings read and/or modified programmatically by the web application when it runs.
It is intended that these settings are persisted on a per-installation basis.
// Define the success callback.
function successCB() {
// Get some application settings.
var smtpServer = bondi.appconfig.get('smtp.server');
var smtpPort = bondi.appconfig.get('smtp.port');
}
// Define the error callback.
function errorCB(err) {
alert("Failed to acquire BONDI appconfig API: " + err.message);
}
// Request the appconfig feature.
bondi.requestFeature(successCB, errorCB, "appconfig");
This is the URI used to declare this API's feature set, for use in bondi.requestFeature. For the URL, the list of features included by the feature set is provided.
All AppConfig features
Includes API features:
http://bondi.omtp.org/api/appconfig.set
http://bondi.omtp.org/api/appconfig.get
This is the list of URIs used to declare this API's features, for use in bondi.requestFeature. For each URL, the list of functions covered is provided.
When any of the features
http://bondi.omtp.org/api/appconfig.get
http://bondi.omtp.org/api/appconfig.set
is successfully requested, the interface
AppConfigManager
is instantiated, and the resulting object appears in the global
namespace as
Bondi.appConfigManager.
appconfig settings retrieval operations.
Device capabilities:
appconfig.get
appconfig set value operations
Device capabilities:
appconfig.set
appconfig.set
Sets application configuration setting
Security parameters:
key:
configuration setting key
appconfig.get
Gets application configuration setting
Security parameters:
key:
configuration setting key
AppConfigManager
Interface to set/retrieve appconfig settings.
interface AppConfigManager {
DOMString get(in DOMString key)
raises(SecurityError);
void set(in DOMString key, in DOMString value)
raises(SecurityError);
};
get
Retrieves the setting value for the given key.
DOMString get(in DOMString key);
PERMISSION_DENIED_ERROR when access is denied by the security policy.
// Get some application settings.
var smtpServer = bondi.appconfig.get('smtp.server');
var smtpPort = bondi.appconfig.get('smtp.port');
set
Set the value for the given key.
void set(in DOMString key, in DOMString value);
PERMISSION_DENIED_ERROR when access is denied by the security policy.
// Change an application setting.
bondi.appconfig.set('smtp.port','25');
AppConfigManagerObject
Specifies what is instantiated at feature request
interface AppConfigManagerObject {
readonly attribute AppConfigManager appConfigManager;
};
Bondi implements AppConfigManagerObject;