The initial screen is the startpane. This asks the user to either start a new GREWP locally, or join a GREWP. A GREWP is specified by a triple: (host, port, session-name) and it provides a GroupServer service for the members of the GREWP.
Start a local Grewp
Connect to a Grewp
What is a GREWP
The GroupServer allows users to create/join echo-groups. Members of an echo-group can send messages (as Scheme terms) to the group, those messages are serialized and echoed back to all members of the group (self included).
Once the user joins a GREWP (possibly one they create locally) They see a window containing a single "grewp+chat" tabs
The Grewp tab shows all users connected to the GREWP, it shows all documents being editted by members of the GREWP, it also provides a standard chat window which allows the user to talk to the entire GREWP. It also has a button which allows the user to select a color that will be used to highlight all of his/her contributions The user can create a new shared document (by clicking on "new") or can join an editing session for another document (by selecting on the document and clicking "open"). In either case, a Document tab is added to the window.
The Document tab has three components:
It also has a File menu with the standard New/Open/Save/Save-as/Close menuitems. When all members of a document stop editing it, the document is removed from the Grewp and is no longer accessible. Each user's chat contributions are highlighted in the user's color Likewise, their location in the file is noted by highlighting the area just before their position in their color. The Document tab also supports a KillRing where all deletions larger than size 1 are stored in a list. The user can cycle through the list looking at all deletions (and can cut/paste parts of any deletion back into the edit window). There is currently no "undo" button, but the KillRing partly fills that role.
Each user initially joins the "grewp+chat" echo-group. This group provides a mechanism for users to communicate with each other, either through chatting or at the program level through sending messages and adding listeners to the grewp+chat group.
Each time a document is created, the server creates a new echo-group for the document (the name of the group is the name of the document) and all who want to edit the document will join the group. The server also creates a GroupTextAreaServer (GTAS) to serialize all of the client editing commands and transform them so there are no conflcts, after which is sends the modified commands to all members of the group.
Thus if there are D documents being edited, then there are D+1 groups (the grewp+chat is the additional group). If there are U GrewpEdit clients that have been started (and one of them was started as a server), then there will be U+1 user names and the total number of GroupClient connections will be
The GroupClients each add two threads. These are obects that manage the connection to the GroupServer and are created for the grewp+chat as well as for each shared document that is joined. In the latter case, the filename is used as the group name. One thread listens for strings coming in on the socket and copies each full line read into a queue. The second thread, processes the full lines by converting them to Scheme terms and applying any listeners that the user has added.
Each GroupTextAreaServer (GTAS) creates a new GroupClient to communicate with all of the GroupTextAreaClients (GTACs). The filename is used as the name of the group. Currently, all GTAS are created on the GREWP server. An alternative would be to have each user create a GTAS on their machine when they create a new shared document, but in this case, if the originator of a GREWP should lose their connection, then noone else can continue editing the document.
The GroupTextAreaClients (GTACs) also add an additional thread. When the user inserts or deletes string from the shared editor the operations are not carried out immediately, but rather are queued and a separate thread then sends the operations to the GroupTextAreaServer (the GTAS, which runs on the GREWP host) The GTAS serializes the requests and transforms the operations so that they are consistent with each other. The transformed operations are then broadcast back to the group. The GTACs then carry out the transformed operations. Thus, the GTAC implements a "Full Duplex" model where there will be a small delay between typing a character and the character appearing on the screen. The higher the network latency, the longer the delay. In practice, the delay is minimal for a metropolitan network.
In this section we discuss the types of messages that are sent among the members of each group. There are two types of groups: the grewp+chat group that all members of the GREWP belong to, and the document groups that correspond to a single collaboratively edittable document.
sent by client to registrar on server, who sends back user-update and file-update messages. The clients use these messages to update their GREWP awareness features | |
sent by registrar on server | |
sent by registrar on server | |
sent by client NAME after having typed CHAT-TEXT into his/her chat area | |
|
sent when a new user connects to the GREWP |
|
sent when a user leave the GREWP |
|
sent to registrar when user wants to have a GTAS started on the server |
|
sent by registrar when GTAS has been started on the server |
|
sent by all members of the GREWP when a new user requests the chat text with a 'chat-update message |
sent by a new GTAC to GTAS, who sends back the 'contents message below | |
sent by GTAS to GTACs The clients use these messages to update their GREWP awareness features | |
sent by registrar on server | |
sent by registrar on server | |
sent by client NAME after having typed CHAT-TEXT into his/her chat area | |
sent by registrar on server | |
|
sent by GroupServer when new user connects... |
|
... |
|
sent by all users to a new user upon receipt of a 'chat-update message |
|
sent by a new user (with given name) as a request to get current chat-txt |
|
sent by GTAS in response to a get-contents message from a new user TEXT is inserted into the shared textarea |
|
sent by GTAC to GTAS when the user tries to delete some text from the shared textarea |
|
sent by GTAC to GTAS when the user tries to insert some text into the shared textarea |
|
sent by GroupChat component when user submit a chat request |
|
sent by GTAS to GTACs, it provides the official, possibly transformed, operation to be applied by all GTACs to the shared textarea |
|
sent by new user as a request for all users in the group to send their current highlight colors |
|
sent by GTACs in response to a reset-color request. Gives the color and offset for the current user |