D0301
HTML Application SDK  A1.8
Classes | Public Member Functions | List of all members
DatabaseManager Interface Reference

import"DatabaseManagerPlugin.idl";

Classes

interface  keyValueChanged
 

Public Member Functions

void addEventListener ([in] String event_name, [in] EventListener listener)
 
Boolean clear ()
 
String read ([in] String key)
 
void removeEventListener ([in] String event_name, [in] EventListener listener)
 
void removeEventListener ([in] String event_name)
 
Boolean write ([in] String key, [in] String value)
 

Detailed Description

This is a class which implements global DatabaseManager object.

Member Function Documentation

void DatabaseManager.addEventListener ( [in] String  event_name,
[in] EventListener  listener 
)

Adds DOM2 event listener for specified event.

Possible values are: event_name: "keyValueChanged", listener: function that has arguments similar to the keyValueChanged interface properties.

Parameters
event_nameName of the event.
listenerjavascript function that has arguments like the properties listed in the listener's interface.
Boolean DatabaseManager.clear ( )

Clear lookup table.

var clearReturn = DatabaseManager.clear();
Returns
true if lookup table exists and is cleared successfully; false, otherwise.
String DatabaseManager.read ( [in] String  key)

Get data from lookup table of corresponding key. Exceeding size of parameters throws runtime error.

var readReturn = DatabaseManager.read("ValidKey3");
Parameters
keyString that is queried in lookup table - max size is 255 char.
Returns
data if key is found in lookup table; empty string, otherwise.
void DatabaseManager.removeEventListener ( [in] String  event_name,
[in] EventListener  listener 
)

Removes single DOM2 event listener for specified event

Possible values are: event_name: "keyValueChanged", listener: function that has arguments similar to the keyValueChanged interface properties.

Parameters
event_nameName of the event
listenernamed javascript function that has arguments like the properties listed in the listener's interface.
void DatabaseManager.removeEventListener ( [in] String  event_name)

Removes all DOM2 event listeners for specified event

Parameters
event_nameName of the event
See also
removeEventListener([in] String event_name, [in] EventListener listener);
Boolean DatabaseManager.write ( [in] String  key,
[in] String  value 
)

Insert key-value pair into lookup table. If key is already exists in lookup table, then its value is updated. That means key is master and unique. Exceeding size of parameters throws runtime error.

var writeReturn = DatabaseManager.write("ValidKey1", "ValidValue");
Parameters
keydata - max size is 255 char.
valuedata - max size is 255 char.
Returns
true if data is written successfully; false, otherwise.

The documentation for this interface was generated from the following file: