com.ibm.mashups.iwidget.itemset
Interface ItemSet


public ItemSet

Interface to a simple abstraction of a datamodel. This provides a base from which more sofisticated data models can be built.


Method Summary
 ItemSet setLocalizedItemValue(String itemName, Object value, String locale)
           This method sets an item within the ItemSet, creates or replaces an existing entry as needed.
 ItemSet setItemValue(String itemName, Object value, Boolean readOnly)
          Deprecated.  please use setItemValue(itemName,value) readOnly is always false
 ItemSet setItemValue(String itemName, Object value)
           This method sets a nonlocalized value of an item within the ItemSet, creates or replaces an existing entry as needed.
 Object getLocalizedItemValue(String itemName, String locale)
           This method returns the value for the named item in the specified locale.
 ItemSet getItemValue(String itemName)
           This method returns the nonlocalized value for the named item from the set.
 String[] getAllNames()
           This method returns an array of Strings, providing the name of each item.
 ItemSet removeItem(String itemName)
           Removes the named item from the set.
 ItemSet removeItemValue(String itemName)
           Removes the non localized value of the item from the set.
 ItemSet removeLocalizedItemValue(String itemName, String locale)
           Removes the value of the item from the set for a specified locale.
 String[] getLocalesWithValues(String itemName)
           The method returns an array of strings, each providing a locale where a value is defined.
 ItemSet clone()
          Deprecated.  not used
 Boolean isReadOnly(String itemName)
          Deprecated.  always return false
 Object getItemSetDescription()
          Deprecated.  not used
 String addListener(Function listener)
          Deprecated.  not used
 Boolean removeListener(String listenerId)
          Deprecated.  not used
 

Method Detail

setLocalizedItemValue

ItemSet setLocalizedItemValue(String itemName,
                              Object value,
                              String locale)
This method sets an item within the ItemSet, creates or replaces an existing entry as needed. Since only one value is allowed for any one name/locale combination, the supplied value replaces any existing value for the supplied name/locale. When successful, this method MUST return a handle to the ItemSet while on failure it must return null.

Parameters:
itemName - name of the item. Must never be null.
value - value of the item. Must never be null.
locale - specified locale. Must never be null.
Returns:
return an handle of ItemSet upon successful, null upon failure.

setItemValue

ItemSet setItemValue(String itemName,
                     Object value,
                     Boolean readOnly)
Deprecated.  please use setItemValue(itemName,value) readOnly is always false

This method sets an item within the ItemSet, creates or replaces an existing entry as needed. To append a value to any existing item, suggest to get the current value of this item and append the new value to the list and supply the result to this method. Marking an item as ReadOnly indicates to the iContext that while this item maybe shared with other components on the page, the access of those components should not include changing or removing item.

Parameters:
itemName - name of the item. Must never be null.
value - value of the item. Must never be null.
readOnly - optional Boolean attribute to indicate this item is readOnly or not.Default value is false if this parameter is not provided.
Returns:
return an handle of ItemSet upon successful, null upon failure.

setItemValue

ItemSet setItemValue(String itemName,
                     Object value)
This method sets a nonlocalized value of an item within the ItemSet, creates or replaces an existing entry as needed.

Parameters:
itemName - name of the item. Must never be null.
value - value of the item. Must never be null.
Returns:
return an handle of ItemSet upon successful, null upon failure.

getLocalizedItemValue

Object getLocalizedItemValue(String itemName,
                             String locale)
This method returns the value for the named item in the specified locale. On failure this method MUST return null.

Parameters:
itemName - name of the item. Must never be null.
locale - specified locale. Must never be null.
Returns:
return value of the item, null upon failure.

getItemValue

ItemSet getItemValue(String itemName)
This method returns the nonlocalized value for the named item from the set.

Parameters:
itemName - name of the item. Must never be null.
Returns:
return the named item for the set, null upon failure.

getAllNames

String[] getAllNames()
This method returns an array of Strings, providing the name of each item.

Returns:
return an array of items names and return null if the set contains no item

removeItem

ItemSet removeItem(String itemName)
Removes the named item from the set.

Parameters:
itemName - name of the item that needs to be removed. Must never be null.
Returns:
return the handle to the ItemSet upon successful, null upon failure.

removeItemValue

ItemSet removeItemValue(String itemName)
Removes the non localized value of the item from the set.

Parameters:
itemName - name of the item that needs to be removed. Must never be null.
Returns:
return the handle to the ItemSet upon successful, null upon failure.

removeLocalizedItemValue

ItemSet removeLocalizedItemValue(String itemName,
                                 String locale)
Removes the value of the item from the set for a specified locale.

Parameters:
itemName - name of the item that needs to be removed. Must never be null.
locale - a specified locale. Must never be null.
Returns:
return the handle to the ItemSet upon successful, null upon failure.

getLocalesWithValues

String[] getLocalesWithValues(String itemName)
The method returns an array of strings, each providing a locale where a value is defined. The empty string"" is returned for a value without a locale. if the set does not contain the names item, this method must return null.

Parameters:
itemName - name of the item. Must never be null.
Returns:
return an array each providing a locale where a value is defined.

clone

ItemSet clone()
Deprecated.  not used

This method returns a new ItemSet which is a duplicate of the current ItemSet.

Returns:
return a new ItemSet which contains all the data item in the current ItemSet

isReadOnly

Boolean isReadOnly(String itemName)
Deprecated.  always return false

This method returns a Boolean indicating whether or not the item specified by the supplied name can be modified by the user.

Parameters:
itemName - name of the required Item. Must never be null.
Returns:
return a Boolean indicating whether or not the item specified by the supplied name can be modified by the user. Never null.

getItemSetDescription

Object getItemSetDescription()
Deprecated.  not used

As a limitation in Lotus Mashups, this method returns null.

Returns:
return As a limitation in Lotus Mashups, this method returns null.

addListener

String addListener(Function listener)
Deprecated.  not used

This function adds listener to this ShareableItemSet. So it will gets notified when this ShareableItemSet is updated.

Parameters:
listener - js function that should already be properly scoped. Must never be null.
Returns:
return listener id if listener is registered successfully, return null if it's not.

removeListener

Boolean removeListener(String listenerId)
Deprecated.  not used

This function removes the listener from this ShareableItemSet.

Parameters:
listenerId - listener id that's returned by the system when listener is added. Must never be null.
Returns:
return true if listener is removed successfully.


Copyright IBM Corp. 2010 All Rights Reserved.