Packagecom.adobe.rtc.pods.noteClasses
Classpublic class NoteModel
InheritanceNoteModel Inheritance flash.events.EventDispatcher
ImplementsISessionSubscriber

NoteModel is a model component which drives the Note pod. Its job is to keep the shared properties of the note pod synchronized across multiple users. It exposes methods for manipulating that shared model and events indicating when that model changes. In general, users with a publisher role and higher can edit the note while users with a viewer role can only see the note. The note model features synchronized text, selection and scroll position, as well as a list of users currently engaged in editing or creating notes. This component supports "piggybacking" on existing CollectionNodes through its constructor. Developers can avoid CollectionNode proliferation in their applications by pre-supplying a CollectionNode and a nodeName for the NoteModel to use. If none is supplied, the NoteModel will create its own collectionNode for sending and receiving messages.

See also

com.adobe.rtc.pods.Note
com.adobe.rtc.sharedModel.SharedProperty
com.adobe.rtc.sharedModel.CollectionNode


Public Properties
 PropertyDefined by
  accessModel : int
The role value required for accessing the note text
NoteModel
  connectSession : IConnectSession
The IConnectSession with which this component is associated.
NoteModel
  htmlText : String
Specifies the text for the note model.
NoteModel
  isSynchronized : Boolean
[read-only] Determines whether the NoteModel is connected and fully synchronized with the service.
NoteModel
  publishModel : int
The role value required for modifying the note text
NoteModel
  selection : Object
Specifies the selection object for the note model based on two properties:
  • beginIndex
  • endIndex
The notes pod and model offers the option of shared selection; that is, a highlighted item can be highlighted for everyone.
NoteModel
  sharedID : String
Defines the logical location of the component on the service - typically this assigns the sharedID of the collectionNode used by the component.
NoteModel
  usersEditing : ArrayCollection
[read-only] Specifies an ArrayCollection of user userIDs who are currently editing the text.
NoteModel
  usersEditingString : String
[read-only] Specifies a string of user displayNames who are currently editing the text.
NoteModel
  verticalScrollPos : Number
Specifies the shared scroll position for the note model.
NoteModel
Public Methods
 MethodDefined by
  
NoteModel(p_sessionDependentItems:Boolean = false)
Constructor.
NoteModel
  
close():void
Disposes all listeners to the network and framework classes.
NoteModel
  
Gets the NodeConfiguration on a specific node in the Notemodel.
NoteModel
  
getUserRole(p_userID:String):int
Returns the role of a given user for the note.
NoteModel
  
iAmEditing():void
Determines whether the current user is editing.
NoteModel
  
setNodeConfiguration(p_nodeName:String, p_nodeConfiguration:NodeConfiguration):void
Sets the NodeConfiguration on a already defined node in Notemodel.
NoteModel
  
setUserRole(p_userID:String, p_userRole:int, p_nodeName:String = null):void
Sets the role of a given user for the note.
NoteModel
  
subscribe():void
Tells the component to begin synchronizing with the service.
NoteModel
Events
 EventSummaryDefined by
   Dispatched when the text of the note changes NoteModel
   Dispatched when the current user's role changes with respect to this model.NoteModel
   Dispatched when the note text changes.NoteModel
   Dispatched when the selection on the note has changed.NoteModel
   Dispatched when the NoteModel has fully connected and synchronized with the service or when it loses that connection.NoteModel
   Dispatched when the set of users typing changes.NoteModel
Property detail
accessModelproperty
accessModel:int  [read-write]

The role value required for accessing the note text

Implementation
    public function get accessModel():int
    public function set accessModel(value:int):void
connectSessionproperty 
connectSession:IConnectSession  [read-write]

The IConnectSession with which this component is associated. Note that this may only be set once before subscribe is called; re-sessioning of components is not supported. Defaults to the first IConnectSession created in the application.

Implementation
    public function get connectSession():IConnectSession
    public function set connectSession(value:IConnectSession):void
htmlTextproperty 
htmlText:String  [read-write]

Specifies the text for the note model. Only users with a publisher role may set this value.

Implementation
    public function get htmlText():String
    public function set htmlText(value:String):void
isSynchronizedproperty 
isSynchronized:Boolean  [read-only]

Determines whether the NoteModel is connected and fully synchronized with the service.

This property can be used as the source for data binding.

Implementation
    public function get isSynchronized():Boolean
publishModelproperty 
publishModel:int  [read-write]

The role value required for modifying the note text

Implementation
    public function get publishModel():int
    public function set publishModel(value:int):void
selectionproperty 
selection:Object  [read-write]

Specifies the selection object for the note model based on two properties:

The notes pod and model offers the option of shared selection; that is, a highlighted item can be highlighted for everyone. For example, this property can be used to determine the 0-based index within the text for where the selection begins and ends when someone selects some text. This is used with the selectionChange event.

Implementation
    public function get selection():Object
    public function set selection(value:Object):void
sharedIDproperty 
sharedID:String  [read-write]

Defines the logical location of the component on the service - typically this assigns the sharedID of the collectionNode used by the component. sharedIDs should be unique within a room (if they're expressing 2 unique locations). Note that this can only be assigned once (before subscribe() is called). For components with an id property, sharedID defaults to that value.

Implementation
    public function get sharedID():String
    public function set sharedID(value:String):void
usersEditingproperty 
usersEditing:ArrayCollection  [read-only]

Specifies an ArrayCollection of user userIDs who are currently editing the text.

Implementation
    public function get usersEditing():ArrayCollection
usersEditingStringproperty 
usersEditingString:String  [read-only]

Specifies a string of user displayNames who are currently editing the text.

Implementation
    public function get usersEditingString():String
verticalScrollPosproperty 
verticalScrollPos:Number  [read-write]

Specifies the shared scroll position for the note model. Only users with a publisher role may set this value.

Implementation
    public function get verticalScrollPos():Number
    public function set verticalScrollPos(value:Number):void
Constructor detail
NoteModel()constructor
public function NoteModel(p_sessionDependentItems:Boolean = false)

Constructor.

Parameters
p_sessionDependentItems:Boolean (default = false)
Method detail
close()method
public function close():void

Disposes all listeners to the network and framework classes. Recommended for proper garbage collection of the component.

getNodeConfiguration()method 
public function getNodeConfiguration(p_nodeName:String):NodeConfiguration

Gets the NodeConfiguration on a specific node in the Notemodel. If the node is not defined, it will return null

Parameters
p_nodeName:String — The name of the node.

Returns
NodeConfiguration
getUserRole()method 
public function getUserRole(p_userID:String):int

Returns the role of a given user for the note.

Parameters
p_userID:String — UserID of the user in question

Returns
int
iAmEditing()method 
public function iAmEditing():void

Determines whether the current user is editing.

setNodeConfiguration()method 
public function setNodeConfiguration(p_nodeName:String, p_nodeConfiguration:NodeConfiguration):void

Sets the NodeConfiguration on a already defined node in Notemodel. If the node is not defined, it will not do anything.

Parameters
p_nodeName:String — The node Configuration on a node in the NodeConfiguration.
 
p_nodeConfiguration:NodeConfiguration — The name of the node.
setUserRole()method 
public function setUserRole(p_userID:String, p_userRole:int, p_nodeName:String = null):void

Sets the role of a given user for the note.

Parameters
p_userID:String — UserID of the user whose role we are setting
 
p_userRole:int — Role value we are setting
 
p_nodeName:String (default = null)
subscribe()method 
public function subscribe():void

Tells the component to begin synchronizing with the service. For "headless" components such as this one, this method must be called explicitly.

Event detail
changeevent 
Event object type: com.adobe.rtc.events.SharedPropertyEvent

Dispatched when the text of the note changes

onMyRoleChangeevent  
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the current user's role changes with respect to this model.

scrollUpdateevent  
Event object type: com.adobe.rtc.events.SharedModelEvent

Dispatched when the note text changes.

selectionChangeevent  
Event object type: com.adobe.rtc.events.NoteEvent

Dispatched when the selection on the note has changed.

synchronizationChangeevent  
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the NoteModel has fully connected and synchronized with the service or when it loses that connection.

typingListUpdateevent  
Event object type: flash.events.Event

Dispatched when the set of users typing changes.





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/labs/acrobatcom/com/adobe/rtc/pods/noteClasses/NoteModel.html