WebDev is a programming in the what-you-see-is-what-you ...



Designing Dynamic Web Pages in the WYSIWYG Interface

David Wolber, Yingfeng Su, Yih Tsung Chiang,

Department of Computer Science, University of San Francisco

2130 Fulton St., San Francisco, CA. 94117

(415) 422-6451 wolber@usfca.edu

ABSTRACT

WebDev is a programming in the WYSIWYG interface tool for building dynamic web pages that connect to databases. The system allows designers to “program” by entering query by example (QBE) and spreadsheet formulas into visual components of HTML documents. The system then automatically generates dynamic web pages that can be executed in a browser.

INTRODUCTION

WYSIWYG HTML editors such as Microsoft’s Front Page [] have made the design of static web pages easy for end-users (designers who are not programmers). Tools such as WebMacro[] and XMLC[] go a step further by easing the task of designing dynamic web pages. With these tools, the designer works with sample data to specify the presentation of the dynamic page. The programmer is allowed to specify the dynamic content of the page separately.

None of these tools, however, allow a designer to create a complete dynamic web page, including both presentation and content. The designer is still dependent on a programmer. This is unfortunate, especially since end-user programming techniques have proven viable in other domains.

The Spreadsheet is a prime example of an end-user programming environment. The “developer” enters his programs (formulas) directly in table cells, so the “programming” is concrete and direct, and immediate feedback is provided.

Query by example (QBE)[] formulas from the database world are similar. The designer/user enters query expressions directly in table cells, and the system automatically displays the rows that fit the expressions. In this way, the designer is shielded from the complexities of SQL and programming syntax in general.

Both spreadsheets and QBE systems are examples of programming in the interface systems, i.e., system in which the development interface and the target interface are the same. Applications with macro-recording facilities are of this type, as are programming by example (PBE)[] systems like SmallStar[] Eager[] and Mondrian[]. These systems are powerful because the developer programs using the same operations and same interfaces as an end-user.

Programming in the WYSIWYG interface tools are slightly different. Here, the development interface is not the target run-time interface, but a facsimile of it. The developer still gains some benefit from visualizing the development interface as the target interface, but he must mentally map the operations he performs during development to the actual operations that will occur at run-time. These tools are freer, in a sense, as they can provide guides and even dialogs that help the developer. Of course the more guides and helper dialogs, the less WYSIWYG the interface is.

Interactive development environments like Visual Basic are programming in the WYSIWYG tools, but mostly they provide visual methods of designing the static layout of an interface. Specifying the dynamic parts of a program, e.g., what occurs when a button is clicked, requires coding.

In the world of dynamic web page development, Macromedia's Ultradev 4 [4] is as close to a programming in the WYSIWYG system as there exists. Unlike Visual Basic, it allows dynamic parts of a program, even one that views and manipulates a database, to be specified without writing code.

Unfortunately, Ultradev 4’s process still requires programming knowledge; it is only partially programming in the WYSIWYG. For instance, instead of directly specifying how input form parameters of one page affect a visual table on another page, the Ultradev developer must specify how the input data of one page maps to parameters of the other page, how those parameters map to database operations on a result set, and finally, how the result set is mapped to a visual table.

Some of this specification occurs in an interface resembling the target interface, but much of it does not, and much of it involves programming concepts such as parameters and result sets. Because of this, one might say Ultradev 4 is more of a visual interface to a program, as opposed to a programming in the WYSIWYG tool.

We have designed a tool, WebDev, that allows a dynamic web page to be designed directly in the context of the WYSIWYG interface. With WebDev, the designer first maps visual tables to database tables, either using a dialog or by asking the system to generate a table from a sample row. After mapping, visual tables appear with some special rows that guide the designer in specifying add, delete, and select operations (see Figure 1). The designer enters QBE and spreadsheet formulas in these rows.

When the designer enters these formulas, he is not specifying them for the sample data that appears at development time, as in a spreadsheet. Instead, the expressions entered in the WYSIWYG table map to run-time operations that access and manipulate the underlying database table, and, in some cases, also manipulate the run-time view of that table.

This programming in the WYSIWYG scheme allows for more concrete specification of dynamic web pages. The designer never need enter an entire SQL or programming statement, or refer to result sets, parameters, or other items other than named items from the user interface. Through the use of formulas, the designer can directly connect input form parameters with database operations, and thus bypass the circuitous specification necessary in Ultradev 4 and hand-coded web paged development.

At any time during development, the designer can press a button and WebDev will generate code, register it with a server, and run the new dynamic page in a browser. WebDev generates an HTML template file and a Java servlet. The template file is sent to the Lutris XMLC compiler, which generates a Document Object Model (DOM) tree representation. The servlet then manipulates that DOM tree to add the dynamic content.

Experience with the first users of the system suggest that the tool can significantly reduce development time for programmers, and increase the pool of designers that can build complete dynamic web pages.

OVERVIEW OF THE DEVELOPMENT PROCESS

When an HTML table is inserted into the editor, the designer can either map it to existing database table(s) by entering information in a dialog, or enter sample data for it, and tell the system to create the database table automatically. The development-time HTML table then represents both a run-time visual component and the mapped database table (s).

Figure 2 shows one of the dialogs used to map a visual table to a database. Note that the mapping is not from visual table to database table, but from visual table column to database table column. Thus, one visual table can be mapped to multiple databases, and one database table can be viewed in multiple tables.

If the designer saves the program immediately after mapping the database, the resultant web page will display all records of the mapped database table in the visual table. Most the time, of course, the designer desires a more complex web page.

After the mapping, the development-time table appears with one sample row of "live" database data, and four other rows, empty except for labels in the left-most column that help guide the designer (see Figure 1). The first row is an optional header row. The second row displays sample “live” data from the mapped database. The view select, delete select, and add rows are used to specify the database operations that should be performed.

PBE Formatting

The designer formats the sample data in each cell of the sample row. At run-time, the sample formatting of each column is applied to all database data (rows) that appear (e.g., all titles in the table of Figure 1 will appear italicized).

View Select

The designer enters QBE expressions in the view select row to specify the database rows that should be displayed. The designer need not understand SQL syntax, as all expressions are entered in the context of table cells. For example, suppose the designer enters expressions in the view select row as in Table 1. The system will build the query:

SELECT * from BookTable

where InStock>10 and Price>22.00

and use it in the generated servlet so that only the selected books are displayed.

Delete Select

The delete select row is similar to the view selection row, but the QBE entered is used to choose which rows are deleted from the database when the page is invoked. If “Kafka” were entered in the author column of the delete selection row in Figure 1, the following SQL statement would be generated:

DELETE * from BookTable where Author=Kafka

If the delete row is left blank, then no deletions will occur.

Add

The add row facilitates the creation of pages that allow the end-user to enter new records in a table. If one enters constant data in the add row, a record containing that constant data is entered in the database table each time the page is invoked.

Input Forms

Selects, deletes, and adds are often based on something other than the constant data provided in the samples above. In many interfaces, the operations will depend on data entered by the user in an input form.

WebDev allows expressions and formulas to include references to the names of input form data. For instance, in the add row of Figure 1, the designer has entered the names of the input form text boxes.

At run-time, when the Add Button is selected, the values in the text boxes will be used to add a record to the database. Note that the visual table will then be updated using the criteria in the view select row (InStock>10 and Price>22.00).

Query formulas and add expressions can also refer to input form data from another page in the development environment. The designer just qualifies the component name with the page name, e.g., "page1.minimumPrice".

Entry Points

A dynamic web page can be invoked from various other pages and from the page itself. WebDev allows the designer to specify the result page of a button by right-clicking on the button and specifying the name of any open page in the development environment.

When a page is specified as a result page of a button, a new tab appears in the page's development-time window. In Figure 1, there are two tabs—the selected one corresponding to the Add button in the page, and the “Page1.submit” one corresponding to a button in another page. Each tab panel specifies the actions that will occur when the page is loaded as a result of clicking the button the tab represents. For the example in Figure 1, the designer chooses the Add tab to specify what should occur when the Add button is clicked.

Note that when the designer adds new components or modifies the layout of a page, these changes are reflected in all tab panels, no matter which is currently selected.

Spreadsheet Formulas

The facilities described above allow for the development of web pages that access database data, but they don't allow computations on the data. Fortunately, WebDev provides enhanced spreadsheet functionality, similar to [1], which allows computations to be entered. The user can enter complex formulas both in the add row and in table columns that are not mapped to database fields.

When the initial mapping to the database is made, any number of columns in the visual table can be left unmapped. Those unmapped are called "expression" columns. In expression columns of the sample row, the designer can enter formulas that refer to any of the column names of the table. For instance, in Figure 1, “Total” is an expression column, and the designer has entered “Instock*Price” as its formula.

On entry, the formulas are evaluated using the live database data in the other columns of the sample row. This is done only to provide immediate feedback to the user. The computed value (e.g., 340.00) is placed in the cell and the formula appears in the toolbar (as it is in Excel and most spreadsheets). At run-time, the formula is evaluated, in the generated code, for all rows in the database that are to be displayed.

GENERATED CODE

RELATED WORK

UltraDev4 is the union of Dreamweaver with the system formerly known as Cold Fusion. Much can be specified without programming, but not in the direct, in-context manner of WebDev. Take, for instance, the development of a simple page that allows an end-user to add a record using input form data. In UltraDev4, the designer must create a ResultSet object that is mapped to the database table. He then maps the columns of this ResultSet to columns of the visual table- a mapping unnecessary in WebDev since the visual table represents the database table and a view of the table.

Next, the UltraDev4 developer maps the AddRecord operation to the Add button by choosing it from a list of operations. He then maps the input form's text boxes to the parameters of the page being built. Finally, he maps the page parameters to the parameters of the AddRecord operation created earlier.

Schema-Based Web Interface Generators

ASPapp [] is indicative of tools that generate dynamic web pages directly from a database schema. These tools provide an immediate (one-click) web front-end to any existing database. Most provide wizards that allow some specialization of the generated pages. A designer can also edit the generated code after the fact to make layout and other modifications, using whatever tools and editors are available.

Designing web pages in WebDev requires some work, but more customization is possible than with schema-based generators. The designer can specify pages that display and allow any add/delete modification of any number of database tables, and that display database data in lists and combo boxes as well as tables. Because mapping is based on columns, a single visual table can show data from various database tables, and a single database table can be viewed across multiple visual tables. Because the designer can specify the relationship between various submit events and pages, more customization is possible in terms of how various pages are related.

Furthermore, since specialization is facilitated through a wizard in schema-based generation, row selection criteria must be specified out of context with an SQL-like statement. In WebDev, this criteria is specified in the context of the target interface.

Forms/3

Forms/3 is a programming environment based on the spreadsheet. Spreadsheet formulas need not be placed only in cells of a table, but can be entered in any visual component or even as a property of some complex component such as a graphic. Tables need not be of a fixed size, but can contain a variable number of rows and columns.

Like with regular spreadsheets, the data entered in a Forms/3 interface is persistent. But though there is the concept of dynamically sized tables, there is no notion of an underlying store beneath the visible data that the designer manipulates. Forms/3 is thus more concrete, as the designer need not mentally map the development-time tables to run-time database tables. However, it cannot be used to create interfaces to existing databases or to specify traditional database operations.

DODS

Programming by Example

PBE systems such as [] have focused on dynamic web page development, but all in the context of building wrapper programs, i.e., pages that get input from the user, invoke other web page(s), then parse the resultant data and display it to the user.

Our original idea was to apply PBE to the development of web pages that connect to databases.

STATUS AND FUTURE WORK

The version of WebDev reported in this paper was only recently completed.

Our experience with users has been encouraging, but extensive usability testing is needed.

One direction of future work concerns the specification of relational tables in the WebDev framework. Can a table relation be inferred if a designer enters multiple sample rows, where the value of some columns are the same? Are there other ways in which relations can be demonstrated, such as inferring them from the QBE and spreadsheet formulas entered by the designer?

SUMMARY

WebDev allows database operations and computations to be specified in the context of the HTML interface.

REFERENCES

1. ASPAPP Inc.,

2. Bauer, M. Dengler, D.,Paul, G., Meyer, M., Programming by Demonstration for Information Agents, in Your Wish is my Command, Henry Lieberman, Ed. San Francisco: Morgan Kaufmann, 2001

3. Burnett, M. Atwood, J., Djang, R. , Reichwein, J., Gottfried, H. and Yang,S. Forms/3: A First-order Visual Language to Explore the Boundaries of the Spreadsheet Paradigm. Journal of Functional Programming, 11(2):155-206, March 2001

4. Cypher, A., Watch What I do: Programming By Demonstration, MIT Press, London, England, 1993.

5. Lutris, Inc.,

6. Macromedia, Inc.,

7.. Miller, R., Myers, B., Creating Dynamic World Wide Web Pages by Demonstration. Carnegie Mellon University School of Computer Science Technical Report, no. CMU-CS-97-131 and Human Computer Interaction Institute Technical Report, CMU-HCII-97-101. May, 1997.

-----------------------

Figure 1. WebDev Development of a Bookstore page

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download