OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

office-collab message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: food for comparison: operations in webodf


Hi list,

For inspiration, I thought I'd summarize part of the approach we are currently taking with regards to operations in WebODF. All of our current operations are located in one folder. Operations are performed by users that each have a memberid that is unique within a session.
In our current implementation, operations are sent as JSON objects. Each operation object has a timestamp and memberid.

Members and Cursors

In WebODF, the object that is being edited is a session. A session consists of an ODF document and a number of members with or without a cursor. The cursor represents the member in the session. So the member cursors are part of the shared state.

A member can join a session with OpAddMember(memberid, setProperties). The setProperies argument is a dictionary object with information about the member. A member may leave with OpRemoveMember(memberid).

A members cursor can be part of the session but outside of the document. By calling OpAddCursor(memberid), a cursor is added to the first position in the document. A cursor can be removed from the document with the operation OpRemoveCursor(memberid).

To place the cursor at a certain position within the document, the operation OpMoveCursor(memberid, position, length, selectionType) can be called. Since each member has one cursor, the memberid identifies the cursor. The position is a number that indicates a position within the document. A position in combination with a length larger than zero is a selection. The value of length gives the size of the selection. Selections come in two flavours: Region and Range. A Region single frames completely and a Range corresponds to anything else.
The position system is different from what is currently proposed in ODF Collab, which uses an array of container positions. These systems are interchangeble.


Styling

Direct styling can be applied to a document with OpApplyDirectStyling(position, length, setProperties). The position and length have the same definition as in OpMoveCursor.

The setProperties styling information is an object similar to a flattened <style:style/> element. For example, to specify bold text, send the object {text: {font-weight: "bold"}}.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]