jkangash@cc.hut.fi Autumn 2008



Similar documents
HTML Forms. Pat Morin COMP 2405

Developing and Implementing Web Applications with Microsoft Visual C#.NET and Microsoft Visual Studio.NET

User Guide. Chapter 1. SitePublish: Content Management System

How To Create A Website Template On Sitefinity

An introduction to creating JSF applications in Rational Application Developer Version 8.0

Terms and Definitions for CMS Administrators, Architects, and Developers

Product Personalization. User manual

Course Name: Course in JSP Course Code: P5

Introduction to Ingeniux Forms Builder. 90 minute Course CMSFB-V6 P

Elgg 1.8 Social Networking

The Smart Forms Web Part allows you to quickly add new forms to SharePoint pages, here s how:

COMPANIES REGISTRY. Third Party Software Interface Specification. (Part 1 Overview)

Building A Very Simple Web Site

SelectSurvey.NET User Manual

<Insert Picture Here> Oracle Application Express 4.0

Chapter 15: Forms. User Guide. 1 P a g e

Software Requirements Specification For Real Estate Web Site

Web Forms for Marketers 2.3 for Sitecore CMS 6.5 and

About the Authors About the Technical Reviewer

MarkLogic Server. Reference Application Architecture Guide. MarkLogic 8 February, Copyright 2015 MarkLogic Corporation. All rights reserved.

Further web design: HTML forms

Using Form Tools (admin)

San Joaquin County Office of Education Career & Technical Education Web Design ~ Course Outline CBEDS#: 4601

HTML Egg Pro. Tutorials

User Guide for Smart Former Gold (v. 1.0) by IToris Inc. team

E-Commerce Installation and Configuration Guide

Paya Card Services Payment Gateway Extension. Magento Extension User Guide

PHP Form Handling. Prof. Jim Whitehead CMPS 183 Spring 2006 May 3, 2006

IBM BPM V8.5 Standard Consistent Document Managment

This document is intended to provide employers/recruiters with a basic overview and users guide of the Employer/Recruiter section of the job board.

Using JCPS Online for Websites

Page Editor Recommended Practices for Developers

Dell KACE K1000 Management Appliance. Service Desk Administrator Guide. Release 5.3. Revision Date: May 13, 2011

HOW TO CREATE AN HTML5 JEOPARDY- STYLE GAME IN CAPTIVATE

Designing and Implementing Forms 34

E-Commerce Installation and Configuration Guide

Web Design and Development ACS Chapter 13. Using Forms 11/30/2015 1

Standard Checkout. Button Creation Wizard Implementation Guide. U.S. Version

User s Guide. Version 2.1

Introduction to XML Applications

Business Application Development Platform

MasterPass Service Provider Onboarding & Integration Guide Fileand API-Based Merchant Onboarding Version 6.10

USER MANUAL FOR INTERNET BANKING (IB) SERVICE

Expanded contents. Section 1. Chapter 2. The essence off ASP.NET web programming. An introduction to ASP.NET web programming

DNNCentric Custom Form Creator. User Manual

Application Developer Guide

Entrematic E-commerce

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Web Account & E-commerce Quick Reference Guide

10CS73:Web Programming

Top 10 Oracle SQL Developer Tips and Tricks

XForms. National Informatics Centre, Open Technology Centre. -a new generation e-form Introduction

This guide provides additional information about topics covered in the webinar

Form Management Admin Guide

How To Use Titanium Studio

SRCSB General Web Development Policy Guidelines Jun. 2010

PDG Software. Site Design Guide

Instructions for creating a survey using Survey Gizmo

Support/ User guide HMA Content Management System

Techniques for ensuring interoperability in an Electronic health Record

Portals and Hosted Files

Building A Very Simple Website

JBoss SOAP Web Services User Guide. Version: M5

CREATING WEB FORMS WEB and FORMS FRAMES AND

PrintShop Mail Web. Release Notes

IBM Unica emessage Version 8 Release 6 February 13, User's Guide

Sterling Call Center. Upgrade Guide. Release 9.2

MicroStrategy Quick Guide: Creating Prompts ITU Data Mart Support Group, Reporting Services

Marketo Integration Setup Guide

Getting Started with EServer Courses Using EServer.org for Open-Source, Open-Access Teaching

Best Practices: Extending Enterprise Applications to Mobile Devices

Nanacast.com Membership Wizard. and offer setup Manual

InternetVista Web scenario documentation

Microsoft Office SharePoint Designer 2007

Using Database Metadata and its Semantics to Generate Automatic and Dynamic Web Entry Forms

Document Services Online Customer Guide

The Peer Reviewer s Guide to Editorial Manager

Developing and Implementing Windows-Based Applications With Microsoft Visual C#.NET and Microsoft Visual Studio.NET

GUI and Web Programming

SimLab 3D PDF. Settings

... Introduction... 17

Sitecore E-Commerce Cookbook

SelectSurvey.NET Basic Training Class 1

J j enterpririse. Oracle Application Express 3. Develop Native Oracle database-centric web applications quickly and easily with Oracle APEX

NETWRIX EVENT LOG MANAGER

Pay with Amazon Integration Guide

CA Nimsoft Service Desk

ARCHITECTURAL DESIGN OF MODERN WEB APPLICATIONS

Kentico CMS 7.0 E-commerce Guide

Premier.Dell.com Shopping and Ordering Guide

ORACLE BUSINESS INTELLIGENCE WORKSHOP

Zoomer: An Automated Web Application Change Localization Tool

Integrating Oracle Sales Cloud, Release 9 with JD Edwards EnterpriseOne release 9.1 Implementation Guide

Figure Error! No text of specified style in document..1: Project Organization

Transcription:

s and Services in Internet 2008 (4 cr) An jkangash@cc.hut.fi Helsinki University of Technology Autumn 2008 (TKK) Autumn 2008 1 / 44

Outline 1 An 2 An (TKK) Autumn 2008 2 / 44

Outline An 1 2 An (TKK) Autumn 2008 3 / 44

Structure An An application has two parts Form controls provide user input capabilities Instance data contains the actual input data Form controls linked to appropriate parts of instance (TKK) Autumn 2008 4 / 44

Outline An 1 2 An (TKK) Autumn 2008 5 / 44

(MVC) Architecture An Requirement: Easy adaptation to different devices Separate user interface from logic Three components: Model holds all state View provides the user interface allows user actions to change model (TKK) Autumn 2008 6 / 44

MVC Components User View An Model (TKK) Autumn 2008 7 / 44

MVC in An In, MVC components map as follows: Model is a (hidden) template filled in with instance data View consists of the form controls as presented to the user consists of the form controls bound to the instance Controls are specified abstractly to permit same document to be used everywhere (TKK) Autumn 2008 8 / 44

MVC in An In, MVC components map as follows: Model is a (hidden) template filled in with instance data View consists of the form controls as presented to the user consists of the form controls bound to the instance Controls are specified abstractly to permit same document to be used everywhere So what is the point of MVC here? (TKK) Autumn 2008 8 / 44

Model-View Separation An Despite abstraction, sometimes different views are needed Model should be separable from view Model often has pre-defined structure Not always sensible to force UI to mirror structure (TKK) Autumn 2008 9 / 44

Outline An 1 2 An (TKK) Autumn 2008 10 / 44

Basics An Model represented by <model> element Contains <instance>, <submission>, <bind>, possibly <schema> and actions Model referenced through model and ref or bind attributes XPath used to address items in the instance (TKK) Autumn 2008 11 / 44

Example An <xf:model xmlns:xf="http://www.w3.org/2002/xforms" schema="book.xsd" id="form"> <xf:instance> <book isbn="" xmlns="http://example.com/book"> <title/><author><first/><last/></author> </book> </xf:instance> </xf:model> <xf:input model="form" ref="/book/@isbn"> <xf:label>isbn</xf:label></xf:input> <xf:input model="form" ref="/book/title" class="title"> <xf:label>book title</xf:label></xf:input> <xf:group ref="/book/author"> <xf:label>author name</xf:label> <xf:input model="form" ref="first" class="name"> <xf:label>first</xf:label> </xf:input> <xf:input model="form" ref="last" class="name"> <xf:label>last</xf:label> </xf:input> </xf:group> (TKK) Autumn 2008 12 / 44

Example Rendering An (TKK) Autumn 2008 13 / 44

Controls An defines several types of controls Common attributes: appearance, navigation attributes Common child elements: <label>, <help>, <hint>, <alert> (TKK) Autumn 2008 14 / 44

Text Input Controls An Basic text input: <input> element Multi-line text with <textarea> element <secret> element for passwords Data typing: Element type used to style control (calendar, checkbox,... ) Data typing: XML Schema patterns and facets to restrict valid values (TKK) Autumn 2008 15 / 44

Choice Input Controls An <select> element to make multiple choices (list with checkboxes) <select1> to make a single choice (radio buttons) <range> to select from a sequential range (slider) <select> and <select1> can allow free-form entry or not (TKK) Autumn 2008 16 / 44

Triggers and Submission An <trigger> element like a button: used to initiate actions in response to user input Contains <action> element and events that trigger actions Often responds to generic DOMActivate event <submit> element basically a special-purpose trigger Binds to <submission> element of <model> (TKK) Autumn 2008 17 / 44

Other Controls An <output> element shows values from instance data Can use references or calculation <upload> element allows uploading content Binary content sent embedded in XML document, encoded as text Should support acquiring data from peripherals (TKK) Autumn 2008 18 / 44

Grouping An <group> element used to enclose groups of controls Semantic information intended for rendering (TKK) Autumn 2008 19 / 44

Repetition An Some instance data has repetitive structure (in XML Schema, maxoccurs > 1) <repeat> element allows showing this to user Binds to a node set and repeats content for each item in the set Corresponding attributes when host language does not permit elements (e.g., XHTML <table>) (TKK) Autumn 2008 20 / 44

Step-by-Step Filling An Sometimes complete form is large and consists of independent areas <switch> element defines multiple mutually exclusive <case> elements <toggle> element inside <case> changes rendered case (TKK) Autumn 2008 21 / 44

Outline An 1 2 An (TKK) Autumn 2008 22 / 44

Event Handling An Standard XML Events handling: capture, arrival, bubbling Pre-defined elements for handling, no scripting Pre-defined handlers picked based on experience with scripted HTML forms Certain user actions trigger event sequences (TKK) Autumn 2008 23 / 44

Event Types An Four kinds of events Initialization When processor initialized Interaction When user navigates through form Notification When user acts on form Error When something wrong happens (TKK) Autumn 2008 24 / 44

Modifying Instance Structure An Controls only allow values to be changed, not structure Especially repetitive items need structure changes <insert> and <delete> elements provided for this Not usable for generic modification, only homogeneous lists <setvalue> element can be used to set inserted element s content (TKK) Autumn 2008 25 / 44

Binding An The <bind> element can express properties dynamically, based on instance data Additional constraints: Presence, types, predicates Relevancy: Whether part of the model is currently applicable Not the same as hidden cases: Non-relevant data not even submitted Can be used to replace some XML Schema processing (TKK) Autumn 2008 26 / 44

Calculation An The calculate attribute of <bind> allows computation Can use any XPath expression + additional functions Not replaceable with XML Schema (but is with Schematron) Drawbacks of scripting apply (TKK) Autumn 2008 27 / 44

Outline 1 An 2 An (TKK) Autumn 2008 28 / 44

Forms for Shopping Cart An Let s continue with the shopping cart... Primary form: Cart itself Another form: On each item page Checkout process with forms too (TKK) Autumn 2008 29 / 44

Embedding in XHTML An Use XHTML pages with embedded Note: Cannot use HTML! Model goes into document head Controls go into document body, interspersed with regular XHTML (TKK) Autumn 2008 30 / 44

Model for Item An <xf:model schema="cart.xsd" id="item"> <xf:instance> <c:item> <c:id>w013</c:id> <c:name>fancy Widget</c:name> <c:price>16.75</c:price> <c:quantity>1</c:quantity> <c:giftwrap>false</c:giftwrap> </c:item> </xf:instance> <xf:submission id="add" method="post" action="http://example.com/cart0034"/> </xf:model> (TKK) Autumn 2008 31 / 44

Form for Item An <x:h1><xf:output model="item" ref="/c:item/c:name"/></x:h1> <xf:output value="concat( Price, /c:item/c:price, )"/> <xf:input model="item" ref="c:quantity"> <xf:label>how many?</xf:label> </xf:input> <xf:input model="item" ref="c:giftwrap"> <xf:label>giftwrap?</xf:label> </xf:input> <xf:submit submission="add"> <xf:label>add to cart</xf:label> </xf:submit> (TKK) Autumn 2008 32 / 44

Item Page An (TKK) Autumn 2008 33 / 44

Model for Cart An <xf:model schema="cart.xsd" id="cart"> <xf:instance> <c:cart> <c:user>ltc</c:user> <c:item> <c:id>w012</c:id> <c:name>widget</c:name> <c:price>12.00</c:price> <c:quantity>5</c:quantity> <c:cost/> <c:giftwrap>false</c:giftwrap> </c:item>... </c:cart> </xf:instance> <xf:bind nodeset="/c:cart/c:item/c:cost" calculate="../c:price *../c:quantity"/> <xf:submission id="submit" method="post" action="http://example.com/checkout"/> </xf:model> (TKK) Autumn 2008 34 / 44

Form for Cart: Table Skeleton An <x:h1>shopping Cart</x:h1> <xf:output value="concat( Shopping cart for, /c:cart/c:user)"/> <x:table> <x:thead><x:tr> <x:th>item</x:th> <x:th>price</x:th> <x:th>quantity</x:th> <x:th>giftwrap</x:th> <x:th/> </x:tr></x:thead>... </x:table> <xf:output value="sum(/c:cart/c:item/c:cost)"> <xf:label>total price (in ) </xf:label> </xf:output> <xf:output value="if(sum(/c:cart/c:item/c:cost) > 100,15,5)"> <xf:label>shipping costs (in ) </xf:label> </xf:output> <xf:submit submission="submit"> <xf:label>checkout</xf:label> </xf:submit> (TKK) Autumn 2008 35 / 44

Form for Cart: Table Body An <x:tbody xf:repeat-id="cr" xf:repeat-model="cart" xf:repeat-nodeset="/c:cart/c:item"> <x:tr> <x:td><xf:output ref="c:name"/> </x:td> <x:td><xf:output ref="c:price"/> </x:td> <x:td><xf:input ref="c:quantity"/> </x:td> <x:td><xf:input ref="c:giftwrap"/> </x:td> <x:td> <xf:trigger ev:event="domactivate"> <xf:label>remove</xf:label> <xf:delete at="index( cr )" nodeset="/c:cart/c:item"/> </xf:trigger> </x:td> </x:tr> </x:tbody> (TKK) Autumn 2008 36 / 44

Cart Page An (TKK) Autumn 2008 37 / 44

Model for Checkout An <xf:model schema="checkout.xsd" id="co"> <xf:instance> <p:payment> <p:dispatch> <p:name/> <p:address/> <p:country>finland</p:country> </p:dispatch> <p:card> <p:type>visa</p:type> <p:name/> <p:number/> <p:expirymonth>11</p:expirymonth> <p:expiryyear>2008</p:expiryyear> </p:card> </p:payment> </xf:instance> <xf:submission id="complete" method="post" action="https://example.com/complete"/> </xf:model> (TKK) Autumn 2008 38 / 44

Form for Checkout: Skeleton An <xf:switch ref="/p:payment"> <xf:case id="dispatch" selected="true"><xf:label>address</xf:label> <xf:group ref="p:dispatch">... </xf:group> <xf:trigger><xf:label>forward</xf:label> <xf:toggle case="card" ev:event="domactivate"/> </xf:trigger> </xf:case> <xf:case id="card" selected="false"><xf:label>credit card</xf:label> <xf:group ref="p:card">... </xf:group> <xf:trigger><xf:label>back</xf:label> <xf:toggle case="dispatch" ev:event="domactivate"/> </xf:trigger> <xf:submit submission="complete"> <xf:label>confirm</xf:label> </xf:submit> </xf:case> </xf:switch> (TKK) Autumn 2008 39 / 44

Form for Checkout: Dispatch An <xf:input ref="p:name"> <xf:label>name</xf:label> </xf:input> <xf:textarea ref="p:address"> <xf:label>address</xf:label> </xf:textarea> <xf:select1 ref="p:country"> <xf:label>country</xf:label> <xf:item> <xf:label>finland</xf:label><xf:value>finland</xf:value> </xf:item> <xf:item> <xf:label>sweden</xf:label><xf:value>sweden</xf:value> </xf:item> <xf:item> <xf:label>uk</xf:label><xf:value>uk</xf:value> </xf:item> </xf:select1> (TKK) Autumn 2008 40 / 44

Checkout Page: Dispatch An (TKK) Autumn 2008 41 / 44

Form for Checkout: Payment An <xf:select1 ref="p:type"><xf:label>card type</xf:label> <xf:item> <xf:label>visa</xf:label><xf:value>visa</xf:value> </xf:item> <xf:item> <xf:label>mastercard</xf:label><xf:value>mastercard</xf:value> </xf:item> </xf:select1> <xf:input ref="p:name"><xf:label>cardholder name</xf:label> </xf:input> <xf:input ref="p:number"><xf:label>card number</xf:label> </xf:input> <xf:group> <xf:label>expiry</xf:label> <xf:input ref="p:expirymonth"> <xf:label>month</xf:label> </xf:input> <xf:input ref="p:expiryyear"> <xf:label>year</xf:label> </xf:input> </xf:group> (TKK) Autumn 2008 42 / 44

Checkout Page: Payment An (TKK) Autumn 2008 43 / 44

Lecture Over Have a good week! (TKK) Autumn 2008 44 / 44