dojox/data/AtomReadStore (version 1.10)

Summary

A read only data store for Atom XML based services or documents

A data store for Atom XML based services or documents. This store is still under development and doesn't support wildcard filtering yet. Attribute filtering is limited to category or id.

Usage

var foo = new AtomReadStore(args);
dojox/data/AtomReadStore
Parameter Type Description
args object

An anonymous object to initialize properties. It expects the following values:

  • url: The url to a service or an XML document that represents the store
  • unescapeHTML: A boolean to specify whether or not to unescape HTML text
  • sendQuery: A boolean indicate to add a query string to the service URL

See the dojox/data/AtomReadStore reference documentation for more information.

Property Summary

Method Summary

  • _assertIsAttribute(attribute) This function tests whether the item passed in is indeed a valid 'attribute' like type for the store.
  • _assertIsItem(item) This function tests whether the item passed in is indeed an item in the store.
  • _fetchItems(request,fetchHandler,errorHandler) Retrieves the items from the Atom XML document.
  • _getFetchUrl(request)
  • _getItem(element)
  • _getItems(document,request) Parses the document in a first pass
  • _initItem(item) Initializes an item before it can be parsed.
  • _parseItem(item)
  • _unescapeHTML(text)
  • close(request) See dojo/data/api/Read.close()
  • containsValue(item,attribute,value) Check whether the attribute values contain the value
  • getAttributes(item) Return an array of attribute names
  • getFeatures() Return supported data APIs
  • getFeedValue(attribute,defaultValue) Non-API method for retrieving values regarding the Atom feed, rather than the Atom entries.
  • getFeedValues(attribute,defaultValue) Non-API method for retrieving values regarding the Atom feed, rather than the Atom entries.
  • getLabel(item) See dojo/data/api/Read.getLabel()
  • getLabelAttributes(item) See dojo/data/api/Read.getLabelAttributes()
  • getValue(item,attribute,defaultValue) Return an attribute value
  • getValues(item,attribute) Return an attribute value
  • hasAttribute(item,attribute) Check whether an element has the attribute
  • isItem(something) Check whether the object is an item (XML element)
  • isItemLoaded(something) Check whether the object is an item (XML element) and loaded
  • loadItem(keywordArgs) Load an item (XML element)

Properties

label
sendQuery
unescapeHTML
url
urlPreventCache

Configurable preventCache option for the URL.

Methods

_assertIsAttribute(attribute)

This function tests whether the item passed in is indeed a valid 'attribute' like type for the store.

Parameter Type Description
attribute attribute-name-string

The attribute to test for being contained by the store.

_assertIsItem(item)

This function tests whether the item passed in is indeed an item in the store.

Parameter Type Description
item dojo/data/api/Item

The item to test for being contained by the store.

_fetchItems(request,fetchHandler,errorHandler)

Retrieves the items from the Atom XML document.

Parameter Type Description
request undefined
fetchHandler undefined
errorHandler undefined
_getFetchUrl(request)
Parameter Type Description
request undefined
Returns:undefined | number | string
_getItem(element)
Parameter Type Description
element undefined
Returns:object
_getItems(document,request)

Parses the document in a first pass

Parameter Type Description
document undefined
request undefined
Returns:undefined | Array
_initItem(item)

Initializes an item before it can be parsed.

Parameter Type Description
item undefined
_parseItem(item)
Parameter Type Description
item undefined
_unescapeHTML(text)
Parameter Type Description
text undefined
Returns:undefined
close(request)

See dojo/data/api/Read.close()

Parameter Type Description
request dojo/data/api/Request | Object
Optional
containsValue(item,attribute,value)

Check whether the attribute values contain the value

Parameter Type Description
item dojo/data/api/Item

An object to check

attribute attribute | attribute-name-string

A tag name of a child element, An XML attribute name or one of special names

value anything
Returns:any | boolean

True if the attribute values contain the value, otherwise false

getAttributes(item)

Return an array of attribute names

'item' must be have been created by the AtomReadStore instance. tag names of child elements and XML attribute names of attributes specified to the element are returned along with special attribute names applicable to the element including "tagName", "childNodes" if the element has child elements, "text()" if the element has child text nodes, and attribute names in '_attributeMap' that match the tag name of the element.

Parameter Type Description
item dojo/data/api/Item

An XML element

Returns:any | Array

An array of attributes found

getFeatures()

Return supported data APIs

Returns:any | object

"dojo.data.api.Read" and "dojo.data.api.Write"

getFeedValue(attribute,defaultValue)

Non-API method for retrieving values regarding the Atom feed, rather than the Atom entries.

Parameter Type Description
attribute undefined
defaultValue undefined
Returns:undefined
getFeedValues(attribute,defaultValue)

Non-API method for retrieving values regarding the Atom feed, rather than the Atom entries.

Parameter Type Description
attribute undefined
defaultValue undefined
Returns:undefined
getLabel(item)

See dojo/data/api/Read.getLabel()

Parameter Type Description
item dojo/data/api/Item
Returns:undefined | object
getLabelAttributes(item)

See dojo/data/api/Read.getLabelAttributes()

Parameter Type Description
item dojo/data/api/Item
Returns:Array | null
getValue(item,attribute,defaultValue)

Return an attribute value

'item' must be an instance of an object created by the AtomReadStore instance. Accepted attributes are id, subtitle, title, summary, content, author, updated, published, category, link and alternate

Parameter Type Description
item dojo/data/api/Item

An item returned by a call to the 'fetch' method.

attribute attribute | attribute-name-string

A attribute of the Atom Entry

defaultValue anything
Optional

A default value

Returns:any | object

An attribute value found, otherwise 'defaultValue'

getValues(item,attribute)

Return an attribute value

'item' must be an instance of an object created by the AtomReadStore instance. Accepted attributes are id, subtitle, title, summary, content, author, updated, published, category, link and alternate

Parameter Type Description
item dojo/data/api/Item

An item returned by a call to the 'fetch' method.

attribute attribute | attribute-name-string

A attribute of the Atom Entry

Returns:any | object

An array of values for the attribute value found, otherwise 'defaultValue'

hasAttribute(item,attribute)

Check whether an element has the attribute

Parameter Type Description
item dojo/data/api/Item

'item' must be created by the AtomReadStore instance.

attribute attribute | attribute-name-string

An attribute of an Atom Entry item.

Returns:any | boolean

True if the element has the attribute, otherwise false

isItem(something)

Check whether the object is an item (XML element)

Parameter Type Description
something anything
Returns:any | boolean

True if the object is an XML element, otherwise false

isItemLoaded(something)

Check whether the object is an item (XML element) and loaded

Parameter Type Description
something anything
Returns:any | undefined

True if the object is an XML element, otherwise false

loadItem(keywordArgs)

Load an item (XML element)

Parameter Type Description
keywordArgs object

object containing the args for loadItem. See dojo/data/api/Read.loadItem()

Error in the documentation? Can’t find what you are looking for? Let us know!