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:
-
element
ElementThe XML element that represents an association.
_fromOptions
-
commonData
-
comnmonData.isGrouping
Constructs an association with data from an object
Parameters:
-
commonData
ObjectCommon data that is used by the itemMirror library, and is app agnostic
-
displayText
StringDisplay text for the association
-
associatedXooMLFragment
StringURI of the associated XooML fragment for the association
-
associatedItem
StringURI of the associated item
-
associatedXooMLDriver
StringThe associated XooML driver for the association
-
associatedItemDriver
StringThe associated item driver for the association
-
associatedSyncDriver
StringThe associated sync driver of the association
-
localItem
StringThe name/id of the association
-
readOnlyURLtoXooMLfragment
StringUsed in cases where the owner wishes for the XooML fragment representing an item to be public
-
-
comnmonData.isGrouping
BooleanWhether 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.