© 2009 OMTP Ltd. All rights reserved. OMTP and OMTP BONDI are registered trademarks of OMTP Ltd.
To configure applications from the Web context
AppConfigManager
| Interface | Method |
|---|---|
| AppConfigManager | DOMString get(DOMString key) void set(DOMString key, DOMString value) |
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.
// Request the appconfig feature.
bondi.requestFeature(successCB, errorCB, "appconfig");
function successCB() {
// Get some application settings.
var smtpServer = bondi.appconfig.get('smtp.server');
var smtpPort = bondi.appconfig.get('smtp.port');
configureSMTP(smtpServer,smtpPort);
}
function errorCB(err) {
alert("Failed to acquire BONDI appconfig API: " + err.message);
}
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 provided is provided.
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(DOMString key);
// Get some application settings.
var smtpServer = bondi.appconfig.get('smtp.server');
var smtpPort = bondi.appconfig.get('smtp.port');
configureSMTP(smtpServer,smtpPort);
set
Set the value for the given key.
void set(DOMString key, DOMString value);
// Change the application setting.
bondi.appconfig.set('smtp.port','25');