Modeling data entry and operations in WebML S. Ceri, P. Fraternali, A. Bongio, A. Maurino Dipartimento di Elettronica e Informazione, Politecnico di Milano Piazza L. Da Vinci, 32 - 20133 Milano, Italy ceri/fraterna/
[email protected],
[email protected]
Abstract Web Modeling Language (WebML, http://webml.org) is a notation for visually specifying complex Web sites at the conceptual level. All the concepts of WebML are specified both graphically and in XML; in particular, navigation and composition abstractions are based on a restricted number of hypertext components (units) which are assembled into pages and interconnected by links. During implementation, pages and units are automatically translated into server-side scripting templates, which enable the display of data dynamically retrieved from heterogeneous data sources. This paper extends WebML with data entry and operation units, for gathering information from clients and invoking arbitrary operations. Predefined operations are also proposed as built-in primitives for supporting standard updates on the content of the underlying data sources (represented as entities and relationships). This natural extension of WebML permits the visual modeling of Web pages integrating read and write access, an essential aspect of many E-commerce applications (including user profiling and shopping cart management).
1. Introduction Recently, important research efforts have addressed the conceptual modeling of data-intensive Web sites, under the assumption that the data content can be dynamically extracted from external data sources. Problems such as declarative WEB specification [ALW99, AMM98, FP98, CFP98], WEB design patterns [GP*99], or the semantic integration of data deriving from multiple sources [FF*98,GP*97] were extensively studied. In particular, [CFB00] describes WebML, the conceptual model used within the W3I3 Project [CFP99] for designing data-intensive Web sites. So far, most efforts have been focused on data retrieval, the most important aspect of Web site design. However, many applications require also the support of user-driven content generation and update; examples of such applications in Ecommerce include the user profiles maintenance and shopping carts. Most conceptual Web design methods proposed so far do not include primitives for content production and update. Another important problem concerns the seamless integration of automatically generated Web sites with external applications or with pre-existing Web pages, which are not described at the conceptual level. These “legacy” Web applications, which do not use the generative approach proposed by new-generation, model-based Web authoring tools, constitute the majority of current Web applications, and are a commodity that cannot be neglected by pragmatic Web design environments. This paper presents a solution for both the above problems, which smoothly extends WebML by adding two simple hypertext construction primitives for supporting data entry and operations. These abstractions are general and can be easily integrated in other conceptual WEB design models.
2. Preliminaries on WebML The specification of a site in WebML consists of five orthogonal perspectives: 1. The Structural Model expresses the data content of the site, in terms of the relevant entities and relationships expressed by means of the E/R model [Chen76]. 2. The Composition Model specifies which pages compose the hypertext, and which content units make up a page. 3. The Navigation Model expresses links, which are drawn between pages and content units to form the hypertext. 4. The Presentation Model expresses the layout and graphic appearance of pages, independently of the output device and of the rendition language. 5. The Personalization Model expresses personalization requirements. Figure 1 shows a graphic representation of a structural model, describing a simplified data source underlying a site for supporting the sale of records (freely inspired to the popular site http://www.cdnow.com). Artists are associated to their Reviews and Albums and each Album is associated to its Tracks.
Figure 1 - Example of structure schema The composition model of WebML supports six types of units, used to compose a hypertext: • Data units show information about a single object, e.g., an instance of an entity or of a component. The definition of a data unit requires the indication of the concept (entity or component) to which the unit refers and the selection of the attributes to include in the unit content. • Multi-data units show information about a set of objects, e.g., all the instances of an entity or all the components of a composite object. The definition of a multi-data unit requires the specification of the instances to be displayed (e.g., all entities related to a given one by a relationship) and of the data unit used to present such instances. • Index units show a list of objects, where each entry is denoted by a descriptive key, i.e., a subset of the object's attributes. A selection from the index causes the access to another unit, which typically displays more information about the selected object. • Scroller units show commands for accessing the elements of an ordered set of objects (the first, last, previous, next, i-th). • Filter units show edit fields for inputting values used for searching within a set of object(s) those ones that meet a condition. • Direct units denote the connection to a single object that is semantically related to another object by means of a one-to-one or many-to-one relationship.
Figure 2: Example of hypertext built with WebML composition and navigation primitives. Units are assembled into pages, which represent the abstraction of a self-contained region of the screen treated as an independent interface block (e.g., delivered to the user independently and in one shot). Examples of concrete implementations of the abstract concept of page in specific languages may be a frame in HTML or a deck in WML. Units and pages are connected to form a hypertext structure, by means of WebML links, which connect units in a way coherent to the semantics expressed by the structure schema of the application. We consider contextual links, which carry some information (called context) from the source unit to the destination unit. Figure 2 shows a hypertext comprising a page showing an album, the (single) artist who issued it, and the index of its tracks. From the ArtistInfo unit it is possible to access the artist's biography and a list of reviews, placed on distinct pages. More information about the semantics of units, links, and hypertexts in WebML can be found at http://webml.org and in [CFB00].
3. WebML support for data entry and operations Introducing data entry and operations affects composition and navigation modeling, because data entry forms are part of the composition of pages and operations are invoked as a side effect of navigation. The composition model is extended with data entry and operation units. The navigation model is extended by adding to links the property of being operation-activating and by distinguishing a special class of links, called KO-links, associated with execution failure.
3.1 Data entry units Data entry units are used for collecting input values into fields, which are then fed as parameters to operations for performing the required processing (e.g., content updates, searches, external operations). The value of each field is either a constant expression, or extracted from the database, or provided by the user. If a field has mode “in” it is initialized by means of a default expression and then remains immutable; “out” fields are not initialized and specified interactively by the user; “inout" fields are initialized by means of a default expression and then modifiable interactively by the user. Default values are specified as expressions referencing context parameters of incoming links. Additional WebML properties of data entry units, not covered in this paper, describe integrity constraints on input fields, such as type information and Boolean expressions defining admissible values. Data entry units have one or more outgoing links, each of which corresponds to the acceptance of the user input and its submission to a given destination unit. These links have an associated context including all the parameter values of the data entry unit and are implemented in HTML and WebML as the SUBMIT commands of a FORM. The specification of data entry units (as of any other unit in WebML) is given in XML, according to the following syntax:
ID CDATA (in|out|inout) CDATA
#REQUIRED #IMPLIED 'out' #IMPLIED>
3.2 Operation units Operation units are used to invoke generic external operations implemented by externally defined WEB pages. They take in input information received by means of one or more links; one of them is declared as operation-activating (optionally denoted by a circled A on the link's arc) and its navigation causes operation execution. Non-activating links may provide additional input information. After operation execution, which may entail an arbitrarily long interaction with external applications, context information can be brought (back) to WebML-modeled units, by one link dynamically selected among the operation’s output links. All the required input parameters should be present when the operation is fired; controlling the correctness of the operation invocation, including the availability and suitability of input parameters, is part of the operation semantics. The specification of operation units is given in XML, according to the following syntax:
3.3 Example Figure 3 describes an example of usage of a data entry unit coupled with an operation unit. The first unit collects user input and forwards it to a subscription operation, by means of an operation-activating link. The XML specification of the example is shown below.
Figure 3 – Example of data entry and operation units The operation unit receives input from a single operation-activating link named link1, coming from a data entry unit, where the user can insert his username and email address. After the navigation of link1, rendered as a submit button, the "subscribe" operation is performed; this takes two parameters from the context of the incoming link (link1.userNameField and link1.emailAddressField), and a third constant parameter, which denotes the name of the mailing list to which the user is subscribing.
4. Predefined Operation Units Several predefined operation units offer the standard operations for updating (at an abstract level) the content of the Web application; they support the creation, update, and deletion of entities and the creation and deletion of relationships. Operation units have a fixed number of input parameters, carried along one or two input links. They have an arbitrary number of output links, but exactly one of them is associated with the failure of the operation. More information on WebML predefined units can be found in [W3I300], available at the site http://webml.org.
4.1 Entity creation The first built-in operation enables the creation of an entity or component. A create unit has as attributes the name of the entity or component being created, and receives from the input links the parameters which correspond to the entity’s attributes. Omitted parameters are treated as null values. The create unit has two output links: a normal link is followed in case of success of the operation and a KO-link is followed in case of failure. The OID of the entity being created is one of the parameters implicitly associated with the OK output link. Figure 4 shows the creation of an artist object.
Figure 4: Example of entity creation unit, coupled with a data entry unit; the OK link brings to the artist unit showing the newly created instance, the KO link brings back to the data entry unit.
4.2 Entity deletion A deletion unit is used to delete a given entity instance. The unit receives from its input link a single parameter, giving the object’s OID. The example of Figure 5 shows an hypertext where an index unit is used to display the descriptive keys of several albums, among which the user may select the one to delete.
Figure 5 - Example of object selection and deletion
4.3 Entity modification A modification unit is used to change the content of a given entity or component instance. The operation receives from its input link a parameter, giving the object or component’s OID; in addition, it requires a link from a data entry unit in order to receive the new attribute values from the user. The modification unit XML syntax explicitly lists the attributes to modify, and thus the update can be restricted to a subset of the object's attributes. Figure 6 shows how an artist's biography can be updated, by first navigating the link to a data entry unit, and then activating the entity modification unit. Both the OK and KO links bring back to the Biography data unit.
Figure 6: Example of a modification unit for changing an artist’s Biography
4.4 Relationship creation A connection unit is used to create instances of relationships between pairs of entities, whose OIDs are the parameters required in input by the unit. Figure 7 shows a page, which includes a new review and the index on all artists. The user selects the artist to whom the review is referred, and then activates the operation by navigating the activating link, whose effect is to connect the selected artist to the review. On success (OK link), a new page describing the selected artist is displayed; on failure (KO link), the initial page is presented again.
Figure 7 - Example of the connection unit to realte an Artist and a Review
4.5 Relationship deletion A disconnection unit is used to drop instances of relationships between pairs of entities, whose OIDs are the parameters required in input by the unit. Figure 8 shows a page containing information about Artists and their albums, whose titles are displayed by an index. Once a title entry is selected, the information about the Album is displayed in the same page. With the selected album displayed, the relationship is deleted as an effect of an explicit navigation of the operationactivating link (as in Figure 3, such an explicit activation may be rendered by a button with an indication of the operation’s side effect). Note that in this example the OIDs of both the instances that must be disconnected flow along a single activating link, as parameters of its context information. The activating link passes to the operation unit also the OID of the artist, taken from the input link coming from AlbumIndexUnit, which by default carries the OID of the object "owning" the relationship instances shown in the index.
Figure 8 - Example of disconnection unit to drop the relationship between an Album and an Artist
Conclusions This paper has shown two new Web modeling abstractions, which integrate data entry and operation invocation into WebML, an existing modeling notation for specifying read-only Web sites. These extensions can be orthogonally combined with primitives for composing hypertexts and defining their navigation, thus building on user skills matured in the conceptual specification of read-only Web sites. WebML is currently applied in the re-engineering of a large ecommerce site, where the write access primitives described in this paper are used to specify and implement a shopping cart connected to a legacy application for order confirmation and delivery. WebML read-only primitives are fully implemented in a Web design tool suite called ToriiSoft (http://www.toriisoft.com). The write extensions described in the paper are under implementation and will be available for beta testing outside the W3I3 Project in early Summer 2000. Following the present implementation of WebML, the novel WebML primitives will be automatically translated into multiple rendition languages (including HTML, WML, XML+XSL, and special-purpose languages for TeleText applications) and server side scripting languages (including MicroSoft's Active Server Pages and JavaSoft's Java Server Pages).
References [ALW99] [AMM98] [Chen76] [CFP98] [CFP99] [CFB00] [FF*98] [FP98]
[GP*99]
[GP*97]
[W3I300]
C.R. Anderson, A. Levy, D.S. Weld, Declarative Web-Site Management with Tiramisù, WebDb99 (Informal Proceedings), 1999. P.Atzeni, G. Mecca, P. Merialdo, Design and maintenance of data-intensive web sites. In Proc. Int. Conf. Extending Database Technology (EDBT), Valencia, Spain, 1998. P. P. Chen, The Entity-Relationship Model, Towards a Unified View of Data, ACM-Transactions on Database Systems, 1:1, 1976, pp. 9-36. S. Ceri, P. Fraternali, S. Paraboschi: Design Principles for Data-Intensive Web Sites, ACM Sigmod Record, 27(4), Dec. 1998, pp.74-80. S.Ceri, P.Fraternali, S.Paraboschi: Data-Driven, One-To-One Web Site Generation for Data-Intensive Applications. VLDB 1999, Edimburgh, Sept. 1999, 615-626. S. Ceri, P. Fraternali, A. Bongio, Web Modeling Language (WebML): a Modeling Language for Designing Web Sites, in Proc. WWW9 Conference, Amsterdam, 2000 (to appear). Mary F. Fernandez, Daniela Florescu, Jaewoo Kang, Alon Y. Levy, Dan Suciu: Catching the Boat with Strudel: Experiences with a Web-Site Management System. SIGMOD Conference 1998: 414-425 P. Fraternali, P.Paolini, A Conceptual model and a tool environment for developing more scalable, dynamic, and customizable Web applications. In Proc. Int. Conf. Extending Database Technology (EDBT), Valencia, Spain, 1998. F. Garzotto, P. Paolini, D. Bolchini, and S. Valenti: "Modeling by patterns" of Web Applications, in Proc. Int. Workshop on the World Wide Web and Conceptual Modeling (Paris, Oct. 1999), Springer-Verlag, LNCS 1727., pp. 293-306. Hector Garcia-Molina, Yannis Papakonstantinou, Dallan Quass, Anand Rajaraman, Yehoshua Sagiv, Jeffrey D. Ullman, Vasilis Vassalos, Jennifer Widom: The TSIMMIS Approach to Mediation: Data Models and Languages. JIIS 8(2): 117-132 (1997) S. Ceri, P. Fraternali, A. Bongio: Specification of WebML, Deliverable W3I3.POLI.D21, March 2000.