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:
- Through a valid Association XML Element
- By specifying all data through an object
For ItemMirror core developers only. Enable protected to see.
Constructor
AssociationEditor
-
options
Parameters:
Item Index
Methods
Properties
- commonData
- commonData.associatedItem
- commonData.associatedItemDriver
- commonData.associatedSyncDriver
- commonData.associatedXooMLDriver
- commonData.associatedXooMLFragment
- commonData.displayText
- commonData.ID
- commonData.isGrouping
- commonData.localItem
- namespace
- namespace.URI
- namespace.URI.attributes
- namespace.URI.attributes
- namespace.URI.data
- namespace.URI.data
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:
-
elementElementThe XML element that represents an association.
_fromOptions
-
commonData -
comnmonData.isGrouping
Constructs an association with data from an object
Parameters:
-
commonDataObjectCommon data that is used by the itemMirror library, and is app agnostic
-
displayTextStringDisplay text for the association
-
associatedXooMLFragmentStringURI of the associated XooML fragment for the association
-
associatedItemStringURI of the associated item
-
associatedXooMLDriverStringThe associated XooML driver for the association
-
associatedItemDriverStringThe associated item driver for the association
-
associatedSyncDriverStringThe associated sync driver of the association
-
localItemStringThe name/id of the association
-
readOnlyURLtoXooMLfragmentStringUsed in cases where the owner wishes for the XooML fragment representing an item to be public
-
-
comnmonData.isGroupingBooleanWhether 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:
A DOM element that can be further manipulated with DOM methods
Properties
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.
