© 2009-2010 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 |
Copyright 2010 OMTP Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This module exposes facilities that relate to application settings and preferences, including:
- static settings defined by the widget author in the configuration document using the preference element
- 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, similar to the the localstorage attribute
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 the feature
http://bondi.omtp.org/api/1.1/appconfig
is successfully requested, the interface
AppConfigManager
is instantiated, and the resulting object appears in the global
namespace as
Bondi.appconfig.
appconfig read and write operations on the appconfig settings.
Device capabilities:
appconfig
appconfig
Sets and gets application configuration setting
AppConfigManager
Interface to set/retrieve appconfig key/values.
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.
function load(){
pws = bondi.appconfig.get("password");
document.getElementById("passwords").value = pws;
}
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.
function save() {
pws = document.getElementById("passwords").value;
bondi.appconfig.set("password", pws);
}
AppConfigManagerObject
Specifies what is instantiated at feature request
interface AppConfigManagerObject {
readonly attribute AppConfigManager appconfig;
};
Bondi implements AppConfigManagerObject;