Keywords: collaborative, MVC, SVG, event, Web Service
Xiaohong Qiu is a Ph.D. student of Syracuse University. She is currently finishing her dissertation at Indiana Unviersity. Publications:
- Xiaohong Qiu, Bryan Carpenter and Geoffrey C. Fox, Internet Collaboration using the W3C Document Object Model , Proceedings of International Conference on Internet Computing, Las Vegas June 2003 http://grids.ucs.indiana.edu/ptliupages/publications/collaborative_dom_conference_2003_Int_IC_font10_without_title_page.pdf
- Sangmi Lee, Xiaohong Qiu et al., Ubiquitous Access for Collaborative Information System using SVG, Proceedings of SVGopen conference July 2002, Zurich, Switzerland. http://www.svgopen.org/papers/2002/lee__garnet_collaborative_info_system/
- Xiaohong Qiu et al., Grid Services for Earthquake Science, Concurrency and Computation: Practice and Experience in ACES Special Issue, 14, 371-393, 2002. http://aspen.ucs.indiana.edu/gemmauisummer2001/resources/gemandit7.doc
- Xiaohong Qiu et al., Collaborative Web Services and Peer-to-Peer Grids, Proceedings of 2003 Collaborative Technologies Symposium Orlando January 20 2003 http://grids.ucs.indiana.edu/ptliupages/publications/foxwmc03keynote.pdf
- Xiaohong Qiu et al., Peer-to-Peer Grids, Chapter 18 of Grid Computing: Making the Global Infrastructure a Reality, book edited by Fran Berman, Geoffrey Fox and Tony Hey, John Wiley and Sons, Chicester, England, ISBN 0-470-85319-0, March 2003.
Grids and Peer-to-Peer networks provide infrastructure for global collaboration of people and shared resources. These observations suggest that applications be built as Web services with clearly defined message based inputs and outputs. We present an approach to make SVG a Web Service and to build synchronous collaborative SVG applications as Web services with a message-based event model. By integrating with the messaging environment NaradaBrokering and the collaborative session control service XGSP, we show a general way of building W3C DOM based applications as collaborative Web Services. We have prototyped a shared SVG browser and a collaborative chess game with SVG to demonstrate our design concepts.
2. Structure of SVG Web Service
2.1 Decomposition of SVG Browser
2.2 Collaborative SVG as a Web Service Model
3. Collaborative SVG Applications
3.1 Architecture of shared SVG browser with no SVG decomposition
3.2 Architecture of multiplayer Internet Game with SVG
4. Structure of Collaborative W3C DOM/SVG Events
4.1 Event Categories
4.2 Master events vs. non-master events
4.3 Major events vs. minor events
4.4 Collaboration as a Web Service (XGSP) Events
4.5 Structure of Collaborative Events
We present a formulation of SVG in a Web service structure exploiting a message-based MVC (Model View Controller) paradigm. This work has two major goals; firstly it allows us to make a very flexible collaborative SVG browser exploiting our general approach for collaborative Web Services [FOX 2003] . Secondly it shows how applications and in particular W3C DOM based applications can be built as Web Services in our case utilizing Batik SVG Browser [BATIK] , which has a well written open source code [QCF 2003] . Building applications as Web Services has several important features; it allows automatic generation of collaborative applications; it unifies distributed and local services; finally it allows easier customization of the user interface to support the needs of clients or users. We discussed the latter point in SVG OPEN 2002 [LFKWQ 2002] , which described PDA interfaces to SVG. In this paper we focus on the Web Service SVG architecture and the structure of the associated event model. We believe that our analysis could suggest architectures for future office and visualization systems, which are built around object models similar to the W3C DOM [DOM2 CORE] [DOM1 CORE] [DOM2 EVENTS] .
In our lab, we have separately developed two useful technology components to support this approach to collaborative applications.
We make the critical observation that Web services are built around messaging – their state is determined by control messages from the user or other services and their “meaning” (in particular their output display) is defined by messages sent from other Web services. This message-based structure allows both the universal implementation of collaboration and the convenient model for universal access. WSRP (Web Services for Remote Portlets) is being developed by OASIS [OASIS] to specify the form of user-facing ports for Web services and WSIA (Web Services for Interactive Applications) and our approach unifies these.
Key features of the architecture of SVG [SVG] and related applications can be derived from the MVC [SMALLTALK 80] [LEE 1994] [MVC MS WINDOWS] picture (Fig. 1). We take the Model component and this essentially becomes the Web Service while the View becomes the user interface. They are linked by the NaradaBrokering publish/subscribe messaging system; the combination of this with the preparation and interpretation of messages corresponds to the Controller MVC component.
When we look at the process of interaction and rendering of a SVG application, we can find that data typically flows through pipelines from one end (Model) to the other (View) and vice versa. There are many ways of decomposing the pipelines and currently we adopt three-stage pipeline architecture as shown in Fig. 1(b). We can assume that each stage of the pipeline is an object that can be used independently or combined with others to provide a Web Service. Each stage also provides a natural synchronization point for a collaboration system.
We analyze all possible events of the SVG browser and divide them into three types corresponding to the three stages of the pipeline in Fig. 1(b). The event types are Raw Events (low level events including mouse and keyboard events), High Level UI Events (DOM/SVG events) and Semantic Events (application events such as shared SVG browser “Open file” events). Raw events are generated in the View and are converted into messages for the Model. One can design different View modules (with trade-offs in complexity and performance) through choice of which High Level UI events and semantic events to process in the Model and which in the View component.
We take the approach that every resource (a data file, a video/audio stream, or even a piece of software like a SVG browser) is an object. A Web Service defines a message based interface for sharing of those distributed objects. In our case here, we share SVG synchronously and make it has a Web Service interacting with clients and other applications or Web Services. We define RFIO (Facing Input and Output ) ports and UFIO (User Facing Input and Output ) ports to distinguish distributed and local service interfaces that surround the Web Service.
The three-stage pipeline model with event-driven message passing mechanism presents a powerful architecture for collaborative SVG applications as Web Services with flexibility and scalability.
We use three collaborative SVG applications to illustrate how we build systems based on different ways of decomposing SVG in the model (Fig. 2). These are not the only possibilities and in particular one could package SVG as three separate modules as shown in Fig. 1(b); we only discuss cases here with one or two independent modules. For a shared SVG browser application, we assume a master and participating client scenario. At any time in a collaborative session, there’s only one client assigned the “master role” (such as a teacher or player to move in a game of chess) and the others are participating clients (such as students or observers and the player who has just moved in chess).
In the case of Fig. 2(a), we aim at making original client side application collaborative with minimal changes to the source code structure. Master events are generated and replicated to participating clients through the NaradaBrokering Message Service. In the case of Fig. 2(b), the heavyweight part of the computation is packaged as a Web Service that runs on a server thus make the client very thin. This design is optimized for ubiquitous access for SVG document over variety of hand held devices like PDA and cellular phone with bitmaps generated at server side and shared among clients [LKF 2003] [LKFKO 2003] . In the case of Fig. 2(c), we have a high performance lightweight version particularly designed for interactivity with the compelling time demands of an Internet game.
Note that we can support collaboration in two extremes ─ firstly the shared input port model where one replicates Web services and delivers events generated on a master View client to all instances of the Model. These service their associated View component. This has maximal flexibility for customization of each collaborative client. In the shared output port of collaboration service, a single Model instance uses NaradaBrokering to multicast rendering information to all collaborating View modules.
This example shows the way to make a client side SVG browser collaborative in a synchronous fashion and how to integrate it into the collaborative environment (Fig. 3). We assume that all clients have the same version of the SVG application so the interpretation and process of semantic events generate consistent results. We can of course use the messaging framework to either check this for running clients or to instantiate the correct version from an SVG “factory” service as for example defined in the OGSI (Open Grid Service Infrastructure) standard [GRID SERVICES] . However we did not implement this yet. At any time, only one client is assigned a master role. The XGSP session control server establishes a collaborative session allowing clients to join and responds to requests (such as changing role from participating client to master or vice versa) from the clients. The NaradaBrokering system provides the publish/subscribe mechanism for the clients to be integrated together under the same topic session. It provides the infrastructure for all messages ─ master events are captured and sent to NaradaBrokering and multicast to other participating clients; control messages (request and response) are delivered between clients and XGSP. In our architecture all messages (low bandwidth control, high bandwidth TCP/IP data exchange and high bandwidth UDP audio-video conferencing) are handled by NaradaBrokering. This allows a uniform approach to transport optimization (such as firewalls), session management (through topics) and fault-tolerance (through agents monitoring publish-subscribe session). We have shown this approach has excellent performance [UPF 2003] [PALLICKARA 2003] .
We define a collaborative event as an object that wraps original SVG events with additional context information needed by the collaboration and Web service model. The context information helps guide the events through the NaradaBrokering system to reach other clients (subscribers in the same session). The receiving clients un-wrap the collaborative event and get an SVG event that defines detailed actions on the SVG DOM. The Model part of Web service application analyses the SVG event based on its type and then delivers the resultant rendering information to the associated View(s). We will describe several types of events and give their structure. We distinguish change events and those that define the full application state; both are fully supported.
As already discussed, we classify SVG events into three categories – Raw UI events, High Level events and Semantic events. Raw events are low level events that are directly generated by user input ─ for example, mouse and keyboard events; High Level events are generated by SVG from Raw events and W3C SVG/DOM events are of this category. Semantic events represent functionality of the SVG application or service. “Zoom” in an SVG browser and “I Resign” in chess are examples of such semantic events.
In our collaborative session, all participating clients subscribe to a session (shared application) topic through NaradaBrokering system. Note NaradaBrokering supports traditional (in publish/subscribe systems) hierarchial topic labels and this is used to conveniently label related event streams. Among the clients in a given shared application, only one client holds the “master” token and generates master events that trigger collaborative behavior in the collaboration group. We term events that come from other participating clients as non-master events. The master token can be changed dynamically. Non-master clients can – as in all such collaborative architectures – choose whether or not to follow precisely the master’s state.
To build a robust system, we have to take into consideration that the following scenarios will occur in the real world: clients will join and leave a collaborative session asynchronously; a client system will crash and reboot; the replay service (recording of the collaborative session so far) is requested, and so forth. For the purpose of synchronization and replay functions, we design a mechanism that marks the possible synchronization point with major events. Major events are selected semantic events (such as load a SVG file and open a new window), which fully specify the application state. Chess game major events correspond to the completion of each move. Minor events are events like “mouse move” specifying “small” system changes. Note NaradaBrokering can save all published events (simply by subscribing a persistent store to the session) and so replay can always be supported.
Collaboration involves sharing state between collaborating applications and we define state in terms of a stream of time-stamped change (minor) events applied to a given initial state, which is a major event. We commit this sequence of changes “every now and then” to form new major events that fully specify the application but keep both the major events and the minor events that led up to them. A change (minor) event based application specification is most powerful as one can dynamically choose which events to accept and which events to discard; further each collaborative client can inject their own events. A state (major) event is the most efficient way of specifying the instantaneous state of an application. By keeping both major and minor events we can trade off performance and flexibility. Note both the full state and change specifications are thought of as “just events”. We have shown [UPF 2003] [PALLICKARA 2003] that NaradaBrokering can efficiently both full state and change events; for example, the Anabas commercial web conferencing system can use NaradaBrokering to handle multi-megabyte shared display events with excellent performance [ANABAS] .
All information in our approach is carried by events transported by NaradaBrokering. The nature of the collaboration (e.g. who is in the session and what applications are shared?) is specified by XGSP and generated by the Collaboration Web Service. This service initiates collaborative applications such as SVG discussed here and for example generates the “master token”. Thus the SVG MVC Controller event handler must process both events specialized to the application and such overall control events.
A collaborative DOM/SVG event contains information such as the following:
The collaborative SVG event processing chart is show in Fig. 5. Note that we serialize SVG events using a natural XPATH syntax to specify DOM node position and its properties.
We believe our prototype shows how a message-based MVC (three-stage pipeline) model can generate a powerful application paradigm suitable for SVG and other presentation style applications. As SVG is an application of DOM, we can generalize the approach for DOM based applications. Our approach suggests that one need not develop special “collaborative” applications. Rather any application developed as a Web service can be made collaborative using the tools and architectural principles discussed in this paper.
XHTML rendition created by gcapaper Web Publisher v2.0, © 2001-3 Schema Software Inc.