API Docs for: 0.8.2
Show:

AssociationEditor Class

AssociationEditor is a minimal interface to represent a XooML2 association. This object is used together with FragmentEditor to fully reprsent a XooML fragment as javascript object. It can be converted seamlessly between an object and XML.

Note that upon construction, this doesn't actually create an association, merely a /representation/ of an association.

There are two ways to construct an AssociationEditor:

  1. Through a valid Association XML Element
  2. By specifying all data through an object

For ItemMirror core developers only. Enable protected to see.

Constructor

AssociationEditor

(
  • options
)
protected

Parameters:

  • options Object

    The options specified for the constructor

    • element Element

      A DOM element that correctly represents an association as specified by the XooML schema.

    • commonData Object

      An object that specifies the data for an association. Look at the private constructor _fromOptions for more details

Methods

_fromElement

(
  • element
)

Takes an association element in XML and then converts that into an AssociationEditor object. Intended to be one of the ways the object is constructed

Parameters:

  • element Element

    The XML element that represents an association.

_fromOptions

(
  • commonData
  • comnmonData.isGrouping
)
private

Constructs an association with data from an object

Parameters:

  • commonData Object

    Common data that is used by the itemMirror library, and is app agnostic

    • displayText String

      Display text for the association

    • associatedXooMLFragment String

      URI of the associated XooML fragment for the association

    • associatedItem String

      URI of the associated item

    • associatedXooMLDriver String

      The associated XooML driver for the association

    • associatedItemDriver String

      The associated item driver for the association

    • associatedSyncDriver String

      The associated sync driver of the association

    • localItem String

      The name/id of the association

    • readOnlyURLtoXooMLfragment String

      Used in cases where the owner wishes for the XooML fragment representing an item to be public

  • comnmonData.isGrouping Boolean

    Whether or not the association is a grouping item

toElement

() Element protected

Converts the object into an association element, which can then be converted to a string or added to the DOM.

Returns:

Element:

A DOM element that can be further manipulated with DOM methods

Properties

commonData

Object

Common Data of the association that is accessible to all applications

commonData.associatedItem

String

The associated item of the association

commonData.associatedItemDriver

String

The associated item driver of the association

commonData.associatedSyncDriver

String

The associated sync driver of the association

commonData.associatedXooMLDriver

String

The associated XooML driver of the association

commonData.associatedXooMLFragment

String

The associated XooML fragment of the association

commonData.displayText

String

Text that describes the association

commonData.ID

String

The GUID of the association

commonData.isGrouping

Boolean

Whether or not the item is a grouping item

commonData.localItem

String

The local item of the association

namespace

Object

Data for the namespaces. Stored as a key pair value, with each namespace referencing the namespace association element for the corresponding namespace.

namespace.URI

Object

The information for a given namespace. Includes both the data, and the attributes. Namespaces URIs must be unique or they will overwrite data from another namespace

namespace.URI.attributes

Object

The attributes of the current namespace, with each attribute having a corresponding value.

namespace.URI.attributes

Object

The attributes of the current namespace, with each attribute having a corresponding value.

namespace.URI.data

String

This is the namespace data stored within the namespace element. Anything can be put here, and it will be stored as a string. ItemMirror will not do anything with the data here and doesn't interact with it at all. It is the responsibility of other applications to properly store information here.

namespace.URI.data

String

This is the namespace data stored within the namespace element. Anything can be put here, and it will be stored as a string. ItemMirror will not do anything with the data here and doesn't interact with it at all. It is the responsibility of other applications to properly store information here.