IBM® Extensions to the Dojo Toolkit

Atom library, data store, and widgets

Atom AppStore Reference:

The AppStore implements three of the dojo.data APIs: Read, Write, and Identity. Read the following reference documentation about each of these APIs:


dojo.data.api.Read

This is an abstract API that data provider implementations follow. For more information on the dojo.data APIs, visit . http://www.dojotoolkit.org/node/98.

Function Summary
Object getValue(Object item, String attribute, String defaultValue)
Retrieves the value of the named attribute on the given item
Array getValues(Object item, String attribute)
Retrieves the values of the named attribute on the given item
Array getAttributes(Object item)
Returns an array with all the attributes of this item
Boolean hasAttribute(Object item, String attribute)
Returns true if the given *item* has a value for the given *attribute*
Boolean containsValue(Object item, String attribute, Object value)
Returns true if the given *value* is one of the values that the getValues method returns
Boolean isItem(Object something)
Returns whether *something* is an item and came from this store instance
Boolean isItemLoaded(Object something)
Returns whether *something* is loaded in local memory
void loadItem(Object keywordArgs)
Given an item, this method loads the item so that a subsequent call to store.isItemLoaded(item) returns true
Object fetch(Object keywordArgs)
Given a query and set of defined options, such as a start and count of items to return, this method runs the query and makes the results available as data items
Object getFeatures()
Returns a simple keyword values object that specifies which interface features that the datastore implements
void close(Object request)
Instructs the store to close out any information associated with a particular request
String getLabel(Object item)
Method to inspect the item and return a user-readable label for the item that provides a general or adequate description of the item
Array getLabelAttributes(Object item)
Method to inspect the item and return an array of what attributes of the item were used to generate its label, if any exist

Function Detail
getValue

getValues

getAttributes

hasAttribute

containsValue

isItem

isItemLoaded

loadItem

fetch

getFeatures

close

getLabel

getLabelAttributes

dojo.data.api.Write

This is an abstract API that data provider implementations follow. This API specifies the functions needed to write to a data store.

Function Summary
Object getFeatures()
See dojo.data.api.Read.getFeatures
Object newItem(Object keywordArgs)
Returns a newly created item
Boolean deleteItem(Object item)
Deletes an item from the store
Boolean setValue(Object item, String attribute, Object value)
Sets the value of an attribute on an item, replacing any previous value or values
Boolean setValues(Object item, String attribute, Array values)
Adds each value in the *values* array as a value of the given attribute on the given item, replacing any previous value or values
Boolean unsetAttribute(Object item, String attribute)
Deletes all the values of an attribute on an item
Boolean save(keywordArgs)
Saves all the changes that have been made locally to the server
Boolean revert()
Discards any unsaved changes
Boolean isDirty(item)
Given an item, isDirty(), returns true if the item has been modified since the last save method completion

Function Detail
getFeatures

newItem

deleteItem

setValue

setValues

unsetAttribute

save

revert

isDirty

dojo.data.api.Identity

This is an abstract API that data provider implementations follow. The functions defined retrieve the individual identity of an item, as well as the attributes that provided the identity.

Function Summary
Object getFeatures()
See dojo.data.api.Read.getFeatures
Object getIdentity(Object item)
Returns a unique identifier for an item
Array getIdentityAttributes(Object item)
Returns an array of attribute names that are used to generate the identity
Object fetchItemByIdentity(Object keywordArgs)
Given the identity of an item, this method returns the item that has that identity through the onItem callback

Function Detail
getFeatures

getIdentity

getIdentityAttributes

fetchItemByIdentity