SlideShare a Scribd company logo
Webformer:a Rapid Application Development
Toolkit for Writing Ajax Web Form Application

David W.L. Cheung         Thomas Y.T. Lee          Patrick K.C. Yee

Center for E-Commerce Infrastructure Development (CECID), Department of
               Computer Science, University of Hong Kong


                       December 10, 2007
Motivation


      Web forms are commonly used to capture data on the web.
      With Asynchronous Javascript and XML (Ajax) programming,
      interactive web forms can be created.
      However, Ajax programming is complex in a way that the
      model-view-controller (MVC) code is not clearly separated.
      We have developed a rapid application development toolkit
      called Webformer to simplify web form programming with
      Ajax.
      Webformer provides a scripting language called Web Form
      Application Language (WebFAL) for modeling web forms and
      generate Javascript/HTML code.
Webformer Architecture

      We have designed an XML-based scripting language called
      Web Form Application Language (WebFAL) for modeling web
      forms.
      A web form model written in WebFAL is complied by our
      Webformer Complier (wfc) to generate the Javascript/HTML
      source to run on the browser.
      A JavaScript engine called webformer.js is provided as
      provides a Javascript library to handle the MVC interactions
      on the browser, e.g. data validation and autocompletion,
      XML document object model (DOM) management, and Ajax
      messaging.
      A Java library called webformer.jar is provided for parsing
      and composing the messages in these formats to ease the
      programming the Java Servlet handlers on the server-side.
Web Form Application Development Lifecycle

   Two-phase life-cycle facilitates
   segregation of duties between                         Gather application requirements

   software developers and web
   designers:
                                                           Specify web form in WebFAL
        Phase 1. The software
                                                                          WebFAL script
        developer first specifies
                                                             Compile WebFAL script
        the model and controller
        of a web form in                                                         Javascript/
                                               XSD+webformer.jar              HTML+webformer.js
        WebFAL.
                                      Develop server-side handlers             Enhance HTML design
        Phase 2. The model is
        then compiled into an
        HTML template for the
                                                          Deploy servlets and HTML file
        web designer to enhance
        the UI view.
Sample Web Form Application
    1. The user enters his username.
       The entered username is
       validated on-the-fly against
       the server database.
    2. The user enters the album
       name while the server
       suggests the possible names
       that match what the user
       types.
    3. The user can upload multiple photos. He can click on the
       [Add Photo] or the [Delete Photo] link to add or delete a
       upload entry.
    4. In each upload entry, the user specifies the photo file name,
       whether he wants to share the photo, and the number of
       prints of the photo he wants to order.
    5. The user clicks on the Submit button to send the form data
       to the server.
Web Form Application Language (WebFAL)

  A WebFAL document has a root element <WebForm/> and consists
  of five kinds of child elements: <Model/>, <Validation/>,
  <Selection/>, <Event/>, and <SubmitUrl/>.
  <WebForm name="PhotoUpload">
      <Model>...</Model>
      <Validation>...</Validation>
      ...
      <Selection>...</Selection>
      ...
      <Event>...</Event>
      ...
      <SubmitUrl>...</SubmitUrl>
  </WebForm>
<Model/> Element
      Specifies the data model of the web form as a hierarchical
      structure of data groups (<Group/>) and data fields
      (<Field/>).
      Each <Field/> is associated with a name and a data type.
      Possible data types include: String, Number, Date,
      DateTime, Time, File and Boolean.
      A <Group/> contains a list of <Field/>s or other
      <Group/>s. The minimum and maximum occurrence for a
      <Field/> or <Group/> on the web form can be specified.
  <Model>
      <Field name="Username">String</Field>
      <Field name="Album">String</Field>
      <Group name="Photo" minOccurs="1" maxOccurs="unbounded">
          <Field name="File">File</Field>
          <Field name="Share">String</Field>
          <Field name="Prints">Number</Field>
      </Group>
  </Model>
<Validation/> Element
     Specifies a set of validation rules for a <Field/> or a
     <Group/>.
     There are two types of validation rules: browser validation
     rules and server validation rules.
     Browser validation rules are some static constraints for
     <Field/>s that can be checked by the browser without
     contacting the server.
     Browser validation rules are some static constraints for
     <Field/>s that can be checked by the browser without
     contacting the server. Available static validation constraints
     are <RegExp/>, <Length/>, <MinLength/>, <MaxLength/>,
     <TotalDigits/>, <FractionDigits/>, <MinInclusive/>,
     <MaxInclusive/>, <MinExclusive/>, and
     <MaxExclusive/>.
     An error message may be specified so that that message is
     reported on the HTML page when the validation fails.
<Validation/> Element (Continued)
       A server validation is dynamically performed by the server.
       The <HandlerUrl/> specifies the URL of the server handler
       that performs the validation.
       At runtime, when the server validation event is triggered, an
       Ajax request containing the data field content is sent to the
       specified handler.
       The server validates the content dynamically and responses to
       the browser with the validation result.
  <Validation id="ValPrints">
      <FractionDigits errorMsg="must be integer">0</FractionDigits>
      <MinInclusive errorMsg="must be greater than 0">0</MinInclusive>
      <MaxInclusive errorMsg="must be less than 10">10</MaxInclusive>
  </Validation>
  <Validation id="ValUser">
      <MinLength errorMsg="must be longer than 6 characters">6</MinLength>
      <MaxLength errorMsg="must be shorter than 20 characters">20</MaxLength>
      <HandlerUrl>/ajax/userval</HandlerUrl>
  </Validation>
<Selection/> Element

     Provides either a static set of coded values for a <Field/> or
     specifies the URL of a server handler that provides some
     suggested values.
     Coded values are a set of permissible values for a data field.
                                         <Selection id="SelShare">
     A <Code/> can be optionally given     <Code text="Share">public</Code>
     a text attribute, which is a          <Code text="Don’t share">
                                             private
     description for presenting on the     </Code>
     web page.                           </Selection>
                                         <Selection id="SelAlbum">
     Suggested values are dynamically      <HandlerUrl>
     generated by a server handler           /ajax/albumsuggest
                                           </HandlerUrl>
     through an XMLHttpRequest.          </Selection>

     <HandlerUrl/> specifies the URL of the server handler.
<Event/> Element

     Specifies an event that can take place in a <Field/> in order
     to trigger some validation or selection operations.
     Each <Event/> binds a <Field/> to one or more
     <Validation/>s or <Selection/>s.
                                  <Event>
     The reference to a             <FieldRef>Username</FieldRef>
     <Field/> is the path of        <ValidationRef>ValUser</ValidationRef>
                                    <Trigger>FocusOff</Trigger>
     <Group/> and <Field/>        </Event>
     names, delimited by a dot,   <Event>
                                    <FieldRef>Album</FieldRef>
     from the root of the           <ValidationRef>SelAlbum</ValidationRef>
     <Model/> to that               <Trigger>KeyUp</Trigger>
     <Field/>, e.g.               </Event>

     Photo.Description.
     <Trigger/> specifies the event type of the data field that
     triggers the specified validations/selections.
<SubmitUrl/> Element




     Specifies the URL of the server handler that processes the
     data submission.
     When a user clicks on the submit button in the web form, the
     form data will be re-validated, packaged in an XML
     document, and submitted to that URL.

  <SubmitUrl>ajax/photoupload</SubmitUrl>
Compilation of WebFAL Scripts
      wfc compiles the WebFAL script into an JavaScript/HTML
      file and picks the HTML component that best represents a
      <Field/>.
      JavaScript code is embedded to handle the validation and
      selection events for the component.
      The web designer may modify this HTML file to enhance the
      view and content of the web page.
      wfc also generates an XSD file from the WebFAL script that
      specifies the XML format of the web form data for submission
      to the server.
      <Model/> and <Validation/>s are converted into XSD
      types and elements.
      The structure of <Group/>s and <Field/>s in <Model/>
      determines the XML structure while the data type of a
      <Field/> determines its XSD data type.
Sample Generated Code Fragments


  <html>
  <head>
  <title>PhotoUpload</title>
  <script language="JavaScript" src="webformer.js"></script>
  ...
  <input type="Album" id="Album_1.1" onkeyup="selfld(this) "/>
  ...
  <input type="text" id="Photo.Prints_1.1" onblur="valfld(this)"/>
  ...
  <a href="javascript:addgrp(Photo)" id="Photo">[Add Photo]</a>
  ...
  </body>
  </html>
Conclusion

   Contributions:
       Rapid application development framework for web client and
       server programming: WebFAL web form modeling language
       and wfc compiler.
       Facilitation of two-phase web development life-cycle.
   Future work:
       Choice of HTML controls for data fields.
             The current version of webformer does not allow the user to
             choose an HTML control (e.g. radio button or drop-down list)
             for a data field (e.g. coded value field).
       Inter-field data validation.
       GUI environment for specifying WebFAL.

More Related Content

What's hot (20)

PDF
Create an application with ember
Chandra Sekar
 
PPTX
MVC Training Part 1
Lee Englestone
 
PPTX
Parallelminds.web partdemo1
parallelminder
 
PDF
Jquery
Gulbir Chaudhary
 
PPTX
Introduction to JSF
SoftServe
 
PDF
Req pro tips
Fran McKain
 
PDF
Oracle EMC 12C Grand Tour
Rakesh Gujjarlapudi
 
DOC
Oa Framework Tutorial
nolimit797
 
PDF
Lab 5a) create a struts application
techbed
 
PPTX
Ch 04 asp.net application
Madhuri Kavade
 
PPTX
Oracle ADF Case Study
Jean-Marc Desvaux
 
PDF
Infolets and OTBI Deep link Actionable Reports - Configuration Work Book
Feras Ahmad
 
PPT
Server Controls of ASP.Net
Hitesh Santani
 
PPTX
New Features of ASP.NET 4.0
Buu Nguyen
 
PPTX
Mvc by asp.net development company in india - part 2
iFour Institute - Sustainable Learning
 
DOCX
Selectionwidgetwhitepaper 140907120000-phpapp02
Nigel Abbott
 
PDF
Building a custom Oracle ADF Component
Wilfred van der Deijl
 
PPSX
11 asp.net session16
Vivek Singh Chandel
 
PPSX
15 asp.net session22
Vivek Singh Chandel
 
Create an application with ember
Chandra Sekar
 
MVC Training Part 1
Lee Englestone
 
Parallelminds.web partdemo1
parallelminder
 
Introduction to JSF
SoftServe
 
Req pro tips
Fran McKain
 
Oracle EMC 12C Grand Tour
Rakesh Gujjarlapudi
 
Oa Framework Tutorial
nolimit797
 
Lab 5a) create a struts application
techbed
 
Ch 04 asp.net application
Madhuri Kavade
 
Oracle ADF Case Study
Jean-Marc Desvaux
 
Infolets and OTBI Deep link Actionable Reports - Configuration Work Book
Feras Ahmad
 
Server Controls of ASP.Net
Hitesh Santani
 
New Features of ASP.NET 4.0
Buu Nguyen
 
Mvc by asp.net development company in india - part 2
iFour Institute - Sustainable Learning
 
Selectionwidgetwhitepaper 140907120000-phpapp02
Nigel Abbott
 
Building a custom Oracle ADF Component
Wilfred van der Deijl
 
11 asp.net session16
Vivek Singh Chandel
 
15 asp.net session22
Vivek Singh Chandel
 

Similar to Webformer: a Rapid Application Development Toolkit for Writing Ajax Web Form Application (20)

PPTX
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
dioduong345
 
PDF
Component Based UI Architecture - Alex Moldovan
ITCamp
 
PPT
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
CUO VEERANAN VEERANAN
 
PPT
Introduction to ASP.NET MVC
Sunpawet Somsin
 
PPT
Spring MVC
yuvalb
 
PPTX
Asp.NET MVC
vrluckyin
 
PPT
Ajax toolkit framework
Sunil Kumar
 
PPT
331592291-HTML-and-Cascading style sheet
stephen972973
 
PDF
Mvc3 crash
Melick Baranasooriya
 
DOCX
JavaScript
Gulbir Chaudhary
 
PPT
MVC
akshin
 
PPTX
Day7
madamewoolf
 
PPTX
Web Service Basics and NWS Setup
Northeastern University
 
PPT
Ajax toolkit-framework
WBUTTUTORIALS
 
PPTX
Model View Controller-Introduction-Overview.pptx
MarioCaday2
 
DOCX
58615764 net-and-j2 ee-web-services
homeworkping3
 
ODP
Spring Portlet MVC
John Lewis
 
DOCX
C# Unit5 Notes
Sudarshan Dhondaley
 
PPTX
Spring mvc
nagarajupatangay
 
DOCX
Server side programming bt0083
Divyam Pateriya
 
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
dioduong345
 
Component Based UI Architecture - Alex Moldovan
ITCamp
 
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
CUO VEERANAN VEERANAN
 
Introduction to ASP.NET MVC
Sunpawet Somsin
 
Spring MVC
yuvalb
 
Asp.NET MVC
vrluckyin
 
Ajax toolkit framework
Sunil Kumar
 
331592291-HTML-and-Cascading style sheet
stephen972973
 
JavaScript
Gulbir Chaudhary
 
MVC
akshin
 
Web Service Basics and NWS Setup
Northeastern University
 
Ajax toolkit-framework
WBUTTUTORIALS
 
Model View Controller-Introduction-Overview.pptx
MarioCaday2
 
58615764 net-and-j2 ee-web-services
homeworkping3
 
Spring Portlet MVC
John Lewis
 
C# Unit5 Notes
Sudarshan Dhondaley
 
Spring mvc
nagarajupatangay
 
Server side programming bt0083
Divyam Pateriya
 
Ad

More from Thomas Lee (17)

PDF
What AI can do for your business
Thomas Lee
 
PDF
多雲策略:別把所有系統跑在同一雲平台上
Thomas Lee
 
PDF
XML Schema Design and Management for e-Government Data Interoperability
Thomas Lee
 
PDF
Automating Relational Database Schema Design for Very Large Semantic Datasets
Thomas Lee
 
PDF
Formal Models and Algorithms for XML Data Interoperability
Thomas Lee
 
PDF
XML Schema Computations: Schema Compatibility Testing and Subschema Extraction
Thomas Lee
 
PDF
Cloud Portability and Interoperability Architecture Model and Best Practices ...
Thomas Lee
 
PDF
Architecture and Practices on Cloud Interoperability and Portability
Thomas Lee
 
PDF
ebXML Technology Development in Hong Kong
Thomas Lee
 
PDF
ebXML and Open Source Software for E-Commerce
Thomas Lee
 
PDF
The Mythical XML
Thomas Lee
 
PDF
Development of Open Source and Standards Technology in Hong Kong
Thomas Lee
 
PDF
Paperless Trading Infrastructure Technology Development in Hong Kong
Thomas Lee
 
PDF
E government Interoperability Infrastructure Development
Thomas Lee
 
PDF
Adopting Web 2.0 in Business World
Thomas Lee
 
PDF
E-Government Interoperability Infrastructure in Hong Kong
Thomas Lee
 
PDF
XML Schema Computations: Schema Compatibility Testing and Subschema Extraction
Thomas Lee
 
What AI can do for your business
Thomas Lee
 
多雲策略:別把所有系統跑在同一雲平台上
Thomas Lee
 
XML Schema Design and Management for e-Government Data Interoperability
Thomas Lee
 
Automating Relational Database Schema Design for Very Large Semantic Datasets
Thomas Lee
 
Formal Models and Algorithms for XML Data Interoperability
Thomas Lee
 
XML Schema Computations: Schema Compatibility Testing and Subschema Extraction
Thomas Lee
 
Cloud Portability and Interoperability Architecture Model and Best Practices ...
Thomas Lee
 
Architecture and Practices on Cloud Interoperability and Portability
Thomas Lee
 
ebXML Technology Development in Hong Kong
Thomas Lee
 
ebXML and Open Source Software for E-Commerce
Thomas Lee
 
The Mythical XML
Thomas Lee
 
Development of Open Source and Standards Technology in Hong Kong
Thomas Lee
 
Paperless Trading Infrastructure Technology Development in Hong Kong
Thomas Lee
 
E government Interoperability Infrastructure Development
Thomas Lee
 
Adopting Web 2.0 in Business World
Thomas Lee
 
E-Government Interoperability Infrastructure in Hong Kong
Thomas Lee
 
XML Schema Computations: Schema Compatibility Testing and Subschema Extraction
Thomas Lee
 
Ad

Recently uploaded (20)

PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
July Patch Tuesday
Ivanti
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 

Webformer: a Rapid Application Development Toolkit for Writing Ajax Web Form Application

  • 1. Webformer:a Rapid Application Development Toolkit for Writing Ajax Web Form Application David W.L. Cheung Thomas Y.T. Lee Patrick K.C. Yee Center for E-Commerce Infrastructure Development (CECID), Department of Computer Science, University of Hong Kong December 10, 2007
  • 2. Motivation Web forms are commonly used to capture data on the web. With Asynchronous Javascript and XML (Ajax) programming, interactive web forms can be created. However, Ajax programming is complex in a way that the model-view-controller (MVC) code is not clearly separated. We have developed a rapid application development toolkit called Webformer to simplify web form programming with Ajax. Webformer provides a scripting language called Web Form Application Language (WebFAL) for modeling web forms and generate Javascript/HTML code.
  • 3. Webformer Architecture We have designed an XML-based scripting language called Web Form Application Language (WebFAL) for modeling web forms. A web form model written in WebFAL is complied by our Webformer Complier (wfc) to generate the Javascript/HTML source to run on the browser. A JavaScript engine called webformer.js is provided as provides a Javascript library to handle the MVC interactions on the browser, e.g. data validation and autocompletion, XML document object model (DOM) management, and Ajax messaging. A Java library called webformer.jar is provided for parsing and composing the messages in these formats to ease the programming the Java Servlet handlers on the server-side.
  • 4. Web Form Application Development Lifecycle Two-phase life-cycle facilitates segregation of duties between Gather application requirements software developers and web designers: Specify web form in WebFAL Phase 1. The software WebFAL script developer first specifies Compile WebFAL script the model and controller of a web form in Javascript/ XSD+webformer.jar HTML+webformer.js WebFAL. Develop server-side handlers Enhance HTML design Phase 2. The model is then compiled into an HTML template for the Deploy servlets and HTML file web designer to enhance the UI view.
  • 5. Sample Web Form Application 1. The user enters his username. The entered username is validated on-the-fly against the server database. 2. The user enters the album name while the server suggests the possible names that match what the user types. 3. The user can upload multiple photos. He can click on the [Add Photo] or the [Delete Photo] link to add or delete a upload entry. 4. In each upload entry, the user specifies the photo file name, whether he wants to share the photo, and the number of prints of the photo he wants to order. 5. The user clicks on the Submit button to send the form data to the server.
  • 6. Web Form Application Language (WebFAL) A WebFAL document has a root element <WebForm/> and consists of five kinds of child elements: <Model/>, <Validation/>, <Selection/>, <Event/>, and <SubmitUrl/>. <WebForm name="PhotoUpload"> <Model>...</Model> <Validation>...</Validation> ... <Selection>...</Selection> ... <Event>...</Event> ... <SubmitUrl>...</SubmitUrl> </WebForm>
  • 7. <Model/> Element Specifies the data model of the web form as a hierarchical structure of data groups (<Group/>) and data fields (<Field/>). Each <Field/> is associated with a name and a data type. Possible data types include: String, Number, Date, DateTime, Time, File and Boolean. A <Group/> contains a list of <Field/>s or other <Group/>s. The minimum and maximum occurrence for a <Field/> or <Group/> on the web form can be specified. <Model> <Field name="Username">String</Field> <Field name="Album">String</Field> <Group name="Photo" minOccurs="1" maxOccurs="unbounded"> <Field name="File">File</Field> <Field name="Share">String</Field> <Field name="Prints">Number</Field> </Group> </Model>
  • 8. <Validation/> Element Specifies a set of validation rules for a <Field/> or a <Group/>. There are two types of validation rules: browser validation rules and server validation rules. Browser validation rules are some static constraints for <Field/>s that can be checked by the browser without contacting the server. Browser validation rules are some static constraints for <Field/>s that can be checked by the browser without contacting the server. Available static validation constraints are <RegExp/>, <Length/>, <MinLength/>, <MaxLength/>, <TotalDigits/>, <FractionDigits/>, <MinInclusive/>, <MaxInclusive/>, <MinExclusive/>, and <MaxExclusive/>. An error message may be specified so that that message is reported on the HTML page when the validation fails.
  • 9. <Validation/> Element (Continued) A server validation is dynamically performed by the server. The <HandlerUrl/> specifies the URL of the server handler that performs the validation. At runtime, when the server validation event is triggered, an Ajax request containing the data field content is sent to the specified handler. The server validates the content dynamically and responses to the browser with the validation result. <Validation id="ValPrints"> <FractionDigits errorMsg="must be integer">0</FractionDigits> <MinInclusive errorMsg="must be greater than 0">0</MinInclusive> <MaxInclusive errorMsg="must be less than 10">10</MaxInclusive> </Validation> <Validation id="ValUser"> <MinLength errorMsg="must be longer than 6 characters">6</MinLength> <MaxLength errorMsg="must be shorter than 20 characters">20</MaxLength> <HandlerUrl>/ajax/userval</HandlerUrl> </Validation>
  • 10. <Selection/> Element Provides either a static set of coded values for a <Field/> or specifies the URL of a server handler that provides some suggested values. Coded values are a set of permissible values for a data field. <Selection id="SelShare"> A <Code/> can be optionally given <Code text="Share">public</Code> a text attribute, which is a <Code text="Don’t share"> private description for presenting on the </Code> web page. </Selection> <Selection id="SelAlbum"> Suggested values are dynamically <HandlerUrl> generated by a server handler /ajax/albumsuggest </HandlerUrl> through an XMLHttpRequest. </Selection> <HandlerUrl/> specifies the URL of the server handler.
  • 11. <Event/> Element Specifies an event that can take place in a <Field/> in order to trigger some validation or selection operations. Each <Event/> binds a <Field/> to one or more <Validation/>s or <Selection/>s. <Event> The reference to a <FieldRef>Username</FieldRef> <Field/> is the path of <ValidationRef>ValUser</ValidationRef> <Trigger>FocusOff</Trigger> <Group/> and <Field/> </Event> names, delimited by a dot, <Event> <FieldRef>Album</FieldRef> from the root of the <ValidationRef>SelAlbum</ValidationRef> <Model/> to that <Trigger>KeyUp</Trigger> <Field/>, e.g. </Event> Photo.Description. <Trigger/> specifies the event type of the data field that triggers the specified validations/selections.
  • 12. <SubmitUrl/> Element Specifies the URL of the server handler that processes the data submission. When a user clicks on the submit button in the web form, the form data will be re-validated, packaged in an XML document, and submitted to that URL. <SubmitUrl>ajax/photoupload</SubmitUrl>
  • 13. Compilation of WebFAL Scripts wfc compiles the WebFAL script into an JavaScript/HTML file and picks the HTML component that best represents a <Field/>. JavaScript code is embedded to handle the validation and selection events for the component. The web designer may modify this HTML file to enhance the view and content of the web page. wfc also generates an XSD file from the WebFAL script that specifies the XML format of the web form data for submission to the server. <Model/> and <Validation/>s are converted into XSD types and elements. The structure of <Group/>s and <Field/>s in <Model/> determines the XML structure while the data type of a <Field/> determines its XSD data type.
  • 14. Sample Generated Code Fragments <html> <head> <title>PhotoUpload</title> <script language="JavaScript" src="webformer.js"></script> ... <input type="Album" id="Album_1.1" onkeyup="selfld(this) "/> ... <input type="text" id="Photo.Prints_1.1" onblur="valfld(this)"/> ... <a href="javascript:addgrp(Photo)" id="Photo">[Add Photo]</a> ... </body> </html>
  • 15. Conclusion Contributions: Rapid application development framework for web client and server programming: WebFAL web form modeling language and wfc compiler. Facilitation of two-phase web development life-cycle. Future work: Choice of HTML controls for data fields. The current version of webformer does not allow the user to choose an HTML control (e.g. radio button or drop-down list) for a data field (e.g. coded value field). Inter-field data validation. GUI environment for specifying WebFAL.