Warning: Use of undefined constant Symbol - assumed 'Symbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: Use of undefined constant JavaScriptSymbol - assumed 'JavaScriptSymbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215

dojox/data/XmlStore.js

  • Provides:

    • dojox.data.XmlItem
  • Requires:

    • dojo.data.util.simpleFetch in common
    • dojo.data.util.filter in common
    • dojox.xml.parser in common
  • dojox.data.XmlStore

    • type
      Function
    • chains:
      • dojo.data.util.simpleFetch: (prototype)
    • parameters:
      • args: (typeof object)
        An anonymous object to initialize properties.  It expects the following values:
    • summary
      A data store for XML based services or documents
    • description
      A data store for XML based services or documents
  • dojox.data.XmlStore.constructor

    • constructor - constructor
    • type
      Function
    • parameters:
      • args: (typeof object)
        An anonymous object to initialize properties.  It expects the following values:
    • summary
      Constructor for the XML store.
  • dojox.data.XmlStore.url

    • type
      The
    • summary
      url to a service or an XML document that represents the store
  • dojox.data.XmlStore.rootItem

    • type
      A
    • summary
      tag name for root items
  • dojox.data.XmlStore.keyAttribute

    • type
      An
    • summary
      attribute name for a key or an identity (unique identifier)
      Required for serverside fetchByIdentity, etc.  Not required for
      client side fetchItemBIdentity, as it will use an XPath-like
      structure if keyAttribute was not specified.  Recommended to always
      set this, though, for consistent identity behavior.
      attributeMap:   An anonymous object contains properties for attribute mapping,
      {"tag_name.item_attribute_name": "@xml_attribute_name", ...}
  • dojox.data.XmlStore.label

    • type
      Object
  • dojox.data.XmlStore.sendQuery

    • type
      A
    • summary
      boolean indicate to add a query string to the service URL.
      Default is false.
  • dojox.data.XmlStore.attributeMap

    • type
      Object
  • dojox.data.XmlStore.urlPreventCache

    • type
      Parameter
    • summary
      to indicate whether or not URL calls should apply
      the preventCache option to the xhr request.
  • dojox.data.XmlStore.getValue

    • parameters:
      • item: (typeof item)
        An XML element that holds the attribute
      • attribute: (typeof attribute)
        A tag name of a child element, An XML attribute name or one of
        special names
      • defaultValue: (typeof value)
        A default value
    • returns
      object|string
    • summary
      Return an attribute value
    • description
      'item' must be an instance of a dojox.data.XmlItem from the store instance.
      If 'attribute' specifies "tagName", the tag name of the element is
      returned.
      If 'attribute' specifies "childNodes", the first element child is
      returned.
      If 'attribute' specifies "text()", the value of the first text
      child is returned.
      For generic attributes, if '_attributeMap' is specified,
      an actual attribute name is looked up with the tag name of
      the element and 'attribute' (concatenated with '.').
      Then, if 'attribute' starts with "@", the value of the XML
      attribute is returned.
      Otherwise, the first child element of the tag name specified with
      'attribute' is returned.
    • return_summary
      An attribute value found, otherwise 'defaultValue'
    • type
      Function
  • dojox.data.XmlStore.getValues

    • parameters:
      • item: (typeof item)
        An XML element that holds the attribute
      • attribute: (typeof attribute)
        A tag name of child elements, An XML attribute name or one of
        special names
    • returns
      array
    • summary
      Return an array of attribute values
    • description
      'item' must be an instance of a dojox.data.XmlItem from the store instance.
      If 'attribute' specifies "tagName", the tag name of the element is
      returned.
      If 'attribute' specifies "childNodes", child elements are returned.
      If 'attribute' specifies "text()", the values of child text nodes
      are returned.
      For generic attributes, if 'attributeMap' is specified,
      an actual attribute name is looked up with the tag name of
      the element and 'attribute' (concatenated with '.').
      Then, if 'attribute' starts with "@", the value of the XML
      attribute is returned.
      Otherwise, child elements of the tag name specified with
      'attribute' are returned.
    • return_summary
      An array of attribute values found, otherwise an empty array
    • type
      Function
  • dojox.data.XmlStore.getAttributes

    • parameters:
      • item: (typeof item)
        An XML element
    • returns
      array
    • summary
      Return an array of attribute names
    • description
      'item' must be an instance of a dojox.data.XmlItem from the store 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.
    • return_summary
      An array of attributes found
    • type
      Function
  • dojox.data.XmlStore.hasAttribute

    • parameters:
      • item: (typeof item)
        'item' must be an instance of a dojox.data.XmlItem from the store instance.
      • attribute: (typeof attribute)
        A tag name of a child element, An XML attribute name or one of
        special names
    • returns
      boolean
    • summary
      Check whether an element has the attribute
    • return_summary
      True if the element has the attribute, otherwise false
    • type
      Function
  • dojox.data.XmlStore.containsValue

    • parameters:
      • item: (typeof item)
        'item' must be an instance of a dojox.data.XmlItem from the store instance.
      • attribute: (typeof attribute)
        A tag name of a child element, An XML attribute name or one of
        special names
      • value: (typeof anything)
    • returns
      boolean
    • summary
      Check whether the attribute values contain the value
    • return_summary
      True if the attribute values contain the value, otherwise false
    • type
      Function
  • dojox.data.XmlStore.isItem

    • parameters:
      • something: (typeof anything)
    • returns
      boolean|boolran
    • summary
      Check whether the object is an item (XML element)
      item:
      An object to check
    • return_summary
      True if the object is an XML element, otherwise false
    • type
      Function
  • dojox.data.XmlStore.isItemLoaded

    • parameters:
      • something: (typeof anything)
    • returns
      boolean
    • summary
      Check whether the object is an item (XML element) and loaded
      item:
      An object to check
    • return_summary
      True if the object is an XML element, otherwise false
    • type
      Function
  • dojox.data.XmlStore.loadItem

    • parameters:
      • keywordArgs: (typeof object)
        containing the args for loadItem.  See dojo.data.api.Read.loadItem()
    • summary
      Load an item (XML element)
    • type
      Function
  • dojox.data.XmlStore.getFeatures

    • returns
      array
    • summary
      Return supported data APIs
    • return_summary
      "dojo.data.api.Read" and "dojo.data.api.Write"
    • type
      Function
  • dojox.data.XmlStore.getLabel

    • parameters:
      • item: (typeof item)
    • returns
      undefined
    • summary
      See dojo.data.api.Read.getLabel()
    • type
      Function
  • dojox.data.XmlStore.getLabelAttributes

    • parameters:
      • item: (typeof item)
    • returns
      array|null
    • summary
      See dojo.data.api.Read.getLabelAttributes()
    • type
      Function
  • dojox.data.XmlStore._fetchItems

    • parameters:
      • request: (typeof A)
        request object
      • fetchHandler: (typeof A)
        function to call for fetched items
      • errorHandler: (typeof A)
        function to call on error
    • summary
      Fetch items (XML elements) that match to a query
    • description
      If 'sendQuery' is true, an XML document is loaded from
      'url' with a query string.
      Otherwise, an XML document is loaded and list XML elements that
      match to a query (set of element names and their text attribute
      values that the items to contain).
      A wildcard, "*" can be used to query values to match all
      occurrences.
      If 'rootItem' is specified, it is used to fetch items.
    • type
      Function
  • dojox.data.XmlStore._getFetchUrl

    • parameters:
      • request: (typeof A)
        request object
    • summary
      Generate a URL for fetch
    • description
      This default implementation generates a query string in the form of
      "?name1=value1&name2=value2..." off properties of 'query' object
      specified in 'request' and appends it to 'url', if 'sendQuery'
      is set to false.
      Otherwise, 'url' is returned as is.
      Sub-classes may override this method for the custom URL generation.
    • return_summary
      A fetch URL
    • type
      Function
  • dojox.data.XmlStore._getItems

    • parameters:
      • document: (typeof An)
        XML document
      • request: (typeof A)
        request object
    • summary
      Fetch items (XML elements) in an XML document based on a request
    • description
      This default implementation walks through child elements of
      the document element to see if all properties of 'query' object
      match corresponding attributes of the element (item).
      If 'request' is not specified, all child elements are returned.
      Sub-classes may override this method for the custom search in
      an XML document.
    • return_summary
      An array of items
    • type
      Function
  • dojox.data.XmlStore._flattenNodes

    • parameters:
      • nodes
    • type
      Function
  • dojox.data.XmlStore.close

    • parameters:
      • request: (typeof dojo.data.api.Request)
        || keywordArgs || null
    • summary
      See dojo.data.api.Read.close()
    • type
      Function
  • dojox.data.XmlStore.newItem

    • parameters:
      • keywordArgs: (typeof object)
        An object containing initial attributes
      • parentInfo
    • returns
      object
    • summary
      Return a new dojox.data.XmlItem
    • description
      At least, 'keywordArgs' must contain "tagName" to be used for
      the new	element.
      Other attributes in 'keywordArgs' are set to the new element,
      including "text()", but excluding "childNodes".
    • return_summary
      An XML element
    • type
      Function
  • dojox.data.XmlStore.deleteItem

    • parameters:
      • item: (typeof item)
        An XML element to delete
    • returns
      boolean
    • summary
      Delete an dojox.data.XmlItem (wrapper to a XML element).
    • return_summary
      True
    • type
      Function
  • dojox.data.XmlStore.setValue

    • parameters:
      • item: (typeof item)
        An XML element that holds the attribute
      • attribute: (typeof attribute)
        A tag name of a child element, An XML attribute name or one of
        special names
      • value: (typeof almost)
        A attribute value to set
    • returns
      boolean
    • summary
      Set an attribute value
    • description
      'item' must be an instance of a dojox.data.XmlItem from the store instance.
      If 'attribute' specifies "tagName", nothing is set and false is
      returned.
      If 'attribute' specifies "childNodes", the value (XML element) is
      added to the element.
      If 'attribute' specifies "text()", a text node is created with
      the value and set it to the element as a child.
      For generic attributes, if '_attributeMap' is specified,
      an actual attribute name is looked up with the tag name of
      the element and 'attribute' (concatenated with '.').
      Then, if 'attribute' starts with "@", the value is set to the XML
      attribute.
      Otherwise, a text node is created with the value and set it to
      the first child element of the tag name specified with 'attribute'.
      If the child element does not exist, it is created.
    • return_summary
      False for "tagName", otherwise true
    • type
      Function
  • dojox.data.XmlStore.setValues

    • parameters:
      • item: (typeof item)
        An XML element that holds the attribute
      • attribute: (typeof attribute)
        A tag name of child elements, an XML attribute name or one of
        special names
        value:
        A attribute value to set
        notify:
        A non-API optional argument, used to indicate if notification API should be called
        or not.
      • values: (typeof array)
    • returns
      boolean
    • summary
      Set attribute values
    • description
      'item' must be an instance of a dojox.data.XmlItem from the store instance.
      If 'attribute' specifies "tagName", nothing is set and false is
      returned.
      If 'attribute' specifies "childNodes", the value (array of XML
      elements) is set to the element's childNodes.
      If 'attribute' specifies "text()", a text node is created with
      the values and set it to the element as a child.
      For generic attributes, if '_attributeMap' is specified,
      an actual attribute name is looked up with the tag name of
      the element and 'attribute' (concatenated with '.').
      Then, if 'attribute' starts with "@", the first value is set to
      the XML attribute.
      Otherwise, child elements of the tag name specified with
      'attribute' are replaced with new child elements and their
      child text nodes of values.
    • return_summary
      False for "tagName", otherwise true
    • type
      Function
  • dojox.data.XmlStore.unsetAttribute

    • parameters:
      • item: (typeof item)
        An XML element that holds the attribute
      • attribute: (typeof attribute)
        A tag name of child elements, an XML attribute name or one of
        special names
    • returns
      boolean
    • summary
      Remove an attribute
    • description
      'item' must be an instance of a dojox.data.XmlItem from the store instance.
      'attribute' can be an XML attribute name of the element or one of
      special names described below.
      If 'attribute' specifies "tagName", nothing is removed and false is
      returned.
      If 'attribute' specifies "childNodes" or "text()", all child nodes
      are removed.
      For generic attributes, if '_attributeMap' is specified,
      an actual attribute name is looked up with the tag name of
      the element and 'attribute' (concatenated with '.').
      Then, if 'attribute' starts with "@", the XML attribute is removed.
      Otherwise, child elements of the tag name specified with
      'attribute' are removed.
    • return_summary
      False for "tagName", otherwise true
    • type
      Function
  • dojox.data.XmlStore.save

    • parameters:
      • keywordArgs: (typeof object)
        An object for callbacks
    • summary
      Save new and/or modified items (XML elements)
    • description
      'url' is used to save XML documents for new, modified and/or
      deleted XML elements.
    • type
      Function
  • dojox.data.XmlStore.revert

    • returns
      boolean
    • summary
      Invalidate changes (new and/or modified elements)
    • return_summary
      True
    • type
      Function
  • dojox.data.XmlStore._newItems

    • type
      Array
  • dojox.data.XmlStore._deletedItems

    • type
      Array
  • dojox.data.XmlStore._modifiedItems

    • type
      Array
  • dojox.data.XmlStore.isDirty

    • parameters:
      • item: (typeof item)
        An item (XML element) to check
    • summary
      Check whether an item is new, modified or deleted
    • description
      If 'item' is specified, true is returned if the item is new,
      modified or deleted.
      Otherwise, true is returned if there are any new, modified
      or deleted items.
    • return_summary
      True if an item or items are new, modified or deleted, otherwise
      false
    • type
      Function
  • dojox.data.XmlStore._saveItem

    • parameters:
      • item
      • keywordArgs
      • method
    • type
      Function
  • dojox.data.XmlStore._getPostUrl

    • parameters:
      • item: (typeof An)
        item to save
    • returns
      string
    • summary
      Generate a URL for post
    • description
      This default implementation just returns 'url'.
      Sub-classes may override this method for the custom URL.
    • return_summary
      A post URL
    • type
      Function
  • dojox.data.XmlStore._getPutUrl

    • parameters:
      • item: (typeof An)
        item to save
    • returns
      string
    • summary
      Generate a URL for put
    • description
      This default implementation just returns 'url'.
      Sub-classes may override this method for the custom URL.
    • return_summary
      A put URL
    • type
      Function
  • dojox.data.XmlStore._getDeleteUrl

    • parameters:
      • item: (typeof An)
        item to delete
    • returns
      string
    • summary
      Generate a URL for delete
    • description
      This default implementation returns 'url' with 'keyAttribute'
      as a query string.
      Sub-classes may override this method for the custom URL based on
      changes (new, deleted, or modified).
    • return_summary
      A delete URL
    • type
      Function
  • dojox.data.XmlStore._getPostContent

    • parameters:
      • item: (typeof An)
        item to save
    • returns
      XML string
    • summary
      Generate a content to post
    • description
      This default implementation generates an XML document for one
      (the first only) new or modified element.
      Sub-classes may override this method for the custom post content
      generation.
    • return_summary
      A post content
    • type
      Function
  • dojox.data.XmlStore._getPutContent

    • parameters:
      • item: (typeof An)
        item to save
    • returns
      XML string
    • summary
      Generate a content to put
    • description
      This default implementation generates an XML document for one
      (the first only) new or modified element.
      Sub-classes may override this method for the custom put content
      generation.
    • return_summary
      A post content
    • type
      Function
  • dojox.data.XmlStore._getAttribute

    • parameters:
      • tagName
      • attribute
    • returns
      object
    • type
      Function
  • dojox.data.XmlStore._getItem

    • parameters:
      • element
    • returns
      object
    • type
      Function
  • dojox.data.XmlStore._getItemIndex

    • parameters:
      • items
      • element
    • returns
      int
    • type
      Function
  • dojox.data.XmlStore._backupItem

    • parameters:
      • item
    • returns
      new or already modified
    • type
      Function
  • dojox.data.XmlStore._restoreItems

    • parameters:
      • items
    • type
      Function
  • dojox.data.XmlStore._forgetItem

    • parameters:
      • item
    • type
      Function
  • dojox.data.XmlStore._getDocument

    • parameters:
      • element
    • returns
      DOMDocument|null
    • type
      Function
  • dojox.data.XmlStore._getRootElement

    • parameters:
      • element
    • returns
      DOMElement
    • type
      Function
  • dojox.data.XmlStore._getXPath

    • parameters:
      • element
    • returns
      string
    • summary
      A function to compute the xpath of a node in a DOM document.
    • description
      A function to compute the xpath of a node in a DOM document.  Used for
      Client side query handling and identity.
    • type
      Function
  • dojox.data.XmlStore.getIdentity

    • parameters:
      • item: (typeof item)
        The XML Item from the store from which to obtain its identifier.
    • returns
      String.
    • summary
      Returns a unique identifier for an item.
    • type
      Function
  • dojox.data.XmlStore.getIdentityAttributes

    • parameters:
      • item: (typeof item)
        The item from the store from which to obtain the array of public attributes that
        compose the identifier, if any.
    • returns
      array|null
    • summary
      Returns an array of attribute names that are used to generate the identity.
    • description
      For XmlStore, if sendQuery is false and no keyAttribute was set, then this function
      returns null, as xpath is used for the identity, which is not a public attribute of
      the item.  If sendQuery is true and keyAttribute is set, then this function
      returns an array of one attribute name: keyAttribute.   This means the server side
      implementation must apply a keyAttribute to a returned node that always allows
      it to be looked up again.
    • type
      Function
  • dojox.data.XmlStore.fetchItemByIdentity

    • parameters:
      • keywordArgs: (typeof object)
    • summary
      See dojo.data.api.Identity.fetchItemByIdentity(keywordArgs)
    • type
      Function
  • dojox.data.XmlStore._attributeMap

    • type
      Object
  • dojox.data.XmlItem

    • type
      Function
    • parameters:
      • element: (typeof An)
        XML element
      • store: (typeof The)
        containing store, if any.
      • query: (typeof The)
        query to use to look up a specific element.
        Usually an XPath or dojo.query statement.
    • summary
      A data item of 'XmlStore'
    • description
      This class represents an item of 'XmlStore' holding an XML element.
      'element'
      element:
      An XML element
  • dojox.data.XmlItem.constructor

    • constructor - constructor
    • type
      Function
    • parameters:
      • element: (typeof An)
        XML element
      • store: (typeof The)
        containing store, if any.
      • query: (typeof The)
        query to use to look up a specific element.
        Usually an XPath or dojo.query statement.
    • summary
      Initialize with an XML element
  • dojox.data.XmlItem.toString

    • returns
      String
    • summary
      Return a value of the first text child of the element
    • return_summary
      a value of the first text child of the element
    • type
      Function
  • dojox.data.XmlItem.element

    • type
      An
    • summary
      XML element
  • dojox.data.XmlItem.store

    • type
      The
    • summary
      containing store, if any.
      query:
      The query to use to look up a specific element.
      Usually an XPath or dojo.query statement.
  • dojox.data.XmlItem.q

  • dojox.data

    • type
      Object
  • dojox

    • type
      Object